curl is a command to transfer data to or from a server, using any supported protocol (HTTP, FTP, IMAP, POP3, SCP, SFTP, SMTP, TFTP, TELNET, LDAP, or FILE). curl is provided by Libcurl. This tool is preferred for automation as it is designed to work without user interaction. curl can transfer multiple files at once.
Join the channel Telegram of the AnonyViet 👉 Link 👈 |
Command curl
can be used directly or Windows CMD or Linux Terminal without installing additional support packages.
I often use Curl for quick testing Website’s status or download the source code without having to use the browser.
Using Curl with Websites with https protocol
If you want to download the Website using https with the curl command, you will get an error:
curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
So let’s add the parameter -k
into the.
Eg: curl -k https://anonyviet.com
Add Referrer with Curl . command
If you want to access the Website with the Curl command with a Referrer, use the parameter --referer
Eg: curl --referer 'https://google.com' -k https://anonyviet.com
Add empty Referrer with Curl . command
Use 2 single strokes in a row ''
Eg: curl --referer '' -k https://anonyviet.com
Add User-Agent with Curl . command
User-Agent helps Webserver identify the device, browser you are accessing the Web site. To use the User-Agent with the curl command, add the parameter --user-agent
Put the user-agent in double quotes ""
Eg: curl --user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.65 Safari/535.11" -k https://anonyviet.com
Add empty User-Agent with Curl . command
Use 2 double quotes or 2 consecutive single quotes
Eg: curl --user-agent "" -k https://anonyviet.com
or
curl --user-agent '' -k https://anonyviet.com