В чем разница между curl и wget ниже?

curl -o mnist.zip -L http://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip

curl: (7) Не удалось подключиться к порту 5870 58.96.175.173: соединение отклонено

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

успешно загрузил mnist.zip.

В чем разница между curl и wget? почему локон отказался?

После попытки curl -v я получил сообщения ниже.

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

Но я до сих пор понятия не имею, почему керлу отказали.

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 получил такой же отказ, как локон, но wget http://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip -o mnist.zip это хорошо. Зачем? В чем здесь разница?

4 ответа

Решение

Вам лучше попытаться проанализировать оба запроса

использование curl -v проанализировать, что вы делаете неправильно, и вы можете проанализировать wget сделать запрос wget -d который показывает, что происходит с wget запрос

Есть два основных различия

  1. В некоторых системах wget не установлен и доступен только curl.
  2. Существует большое преимущество использования wget. wget поддерживает рекурсивную загрузку, а curl - нет.
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.

Это из оригинального источника на http://daniel.haxx.se/docs/curl-vs-wget.html

Когда я удаляю http_proxyвсе становится нормально. Благодаря golimar

Другие вопросы по тегам