Reputation: 805
curl -o mnist.zip -L http://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip
curl: (7) Failed to connect to 58.96.175.173 port 7070: Connection refused
wget -o mnist.zip http://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip
successfully downloaded the mnist.zip.
What is the difference between curl and wget? why curl get refused?
AFTER trying curl -v, I got messages below.
curl -o mnist.zip -L http://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip -v
* Trying 58.96.175.173...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* connect to 58.96.175.173 port 7070 failed: Connection refused
* Failed to connect to 58.96.175.173 port 7070: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 58.96.175.173 port 7070: Connection refused
But I still have no idea why curl got refused.
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.
wget http://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip
got same refused as curl, But wget http://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip -o mnist.zip
is good. Why? What is the differnce here?
Upvotes: 1
Views: 1779
Reputation: 4945
There are two major differences
Upvotes: 1
Reputation: 805
When I remove http_proxy
, everything becomes normal. Thanks to golimar
Upvotes: 0
Reputation: 19
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.
This is from original source at http://daniel.haxx.se/docs/curl-vs-wget.html
Upvotes: 0
Reputation: 8168
You would be better off trying to analyse both the requests
Use curl -v
to analyse what are you doing wrong and you can analyse wget
request by doing wget -d
which shows what is happening with wget
request
Upvotes: 2