Computer paradigms

WGET and CURL on Windows


curl 7.66.0wget and curl are two programs present mainly on Linux focusing on downloading files from the command line. They have been adapted under Windows and offer the same commands as their equivalents under Linux.

wget for Windows

wget can be used in command line and supports different protocols (https, https, ftp).

It allows for example to download a page:

wget --no-check-certificate https://google.fr

To view the headers of a page:

wget --server-response --no-check-certificate https://google.fr

The list of its available parameters can be obtained by doing:

wget --help

Download: wget 1.11.4(388 Ko)

curl for Windows

curl also allows downloading files from the command line but supports many more protocols (http, https, ftp, sftp, imap, ldap, pop3, smtp, telnet, smb...). It manages POST and PUT commands, allowing it to call REST webservices.

To download a page:

curl https://google.fr

To view headers:

curl -I https://google.fr

Here is a complete example in DOS allowing to:

  • pass elements on several lines (with the ^ character)
  • pass parameters with spaces (with quotes)
  • pass JSON (by escaping the quotes)
  • pass HTML tags (escaping the angle brackets with the ^ character)
curl --request POST ^
    --url "https://monurl.com" ^
    --header "accept: application/json" ^
    --header "content-type: application/json" ^
    --data "{"""name""":"""Test""", """emails""":[ """email1@url.com""", """email2@url.com"""], """content""":"""line1 ^<br^> lige2"""}"

Download: curl 7.66.0(2 Mo)

Dernière modification le 23/03/2023 - Quillevere.net


No inscription needed if you wish to

Articles connexes

Search in this website

fr en rss RSS info Informations