下面的curl和wget有什么区别?

下面的curl和wget有什么区别?,curl,wget,Curl,Wget,curl:(7)无法连接到58.96.175.173端口7070:连接被拒绝 curl -o mnist.zip -L http://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip 已成功下载mnist.zip。 curl和wget的区别是什么?为什么会被拒绝 尝试curl-v后,我收到了下面的消息。 curl-o mnist.zip-Lhttp://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip-v *正在尝试58

curl:(7)无法连接到58.96.175.173端口7070:连接被拒绝

curl -o mnist.zip -L http://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip
已成功下载mnist.zip。

curl和wget的区别是什么?为什么会被拒绝

尝试curl-v后,我收到了下面的消息。

curl-o mnist.zip-Lhttp://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip-v

*正在尝试58.96.175.173。。。
%总接收百分比%x平均速度时间电流
数据加载上载总左速度
0 0 0 0 0 0--:-:-:---:-:---:---0*连接到58.96.175.173端口7070失败:连接被拒绝
*无法连接到58.96.175.173端口7070:连接被拒绝
*正在关闭连接0
curl:(7)连接到58.96.175.173端口7070失败:连接被拒绝

但我仍然不知道为什么curl被拒绝了

wget -o mnist.zip http://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip
wgethttp://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip

获得与curl相同的拒绝,但
wgethttp://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip-o mnist.zip
很好。为什么?这里的区别是什么?

您最好尝试分析这两个请求

使用
curl-v
分析您做错了什么,您可以通过执行
wget-d
来分析
wget
请求,它显示了
wget
请求发生了什么

shell> wget http://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip -d

DEBUG output created by Wget 1.15 on linux-gnu.
URI encoding = ‘UTF-8’
URI encoding = ‘UTF-8’
--2016-01-07 11:54:10--  http://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip
Connecting to 58.96.175.173:7070... Closed fd 3
failed: Connection refused.
Releasing 0x0000000002598870 (new refcount 0).
Deleting unused 0x0000000002598870.

这是从原始源代码中获取的,当我删除http_proxy时,一切都变得正常。由于

有两个主要区别

  • 在某些系统上,未安装wget,只有curl可用
  • 使用wget有一个主要优点。wget支持递归下载,而curl不支持

  • 请参考:您是否使用代理或shell中是否设置了代理变量?非常感谢。当我删除http_proxy时,一切都变得正常。
    wget's major strong side compared to curl is its ability to download recursively.
    
    wget is command line only. There's no lib or anything, but curl features and is powered by libcurl.
    
    curl supports FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, FILE, POP3, IMAP, SMTP, RTMP and RTSP. wget supports HTTP, HTTPS and FTP.
    
    curl builds and runs on more platforms than wget.
    
    wget is part of the GNU project and all copyrights are assigned to FSF. 
    
    
    The curl project is entirely stand-alone and independent with no organization parenting at all
    
    curl offers upload and sending capabilities. wget only offers plain HTTP POST support.