cURL Command Cheatsheet

Fetch content from a URL

curl <url>



More Options

-OTo download a filecurl -O
-OCTo download a file with resume capabilitycurl -OC
-LFollow url redirectscurl -L
--max-redirsMaximum redirectscurl -L --max-redirs 5
-vVerbose mode to see request, response headers & Connection informationcurl -v
-HTo ser request headerscurl -H 'User-Agent: Robot'
-XTo specify request methodcurl -X POST

Fequently used Headers

Following are some of the commonly used headers with examples

  1. User-Agent example:
curl -H 'User-Agent: Robot'
  1. Host example:
curl -H 'Host:'

┬ęCopyright 2020 OneCompiler | Privacy Policy | Terms & Conditions