cmdxray / commands / curl

What does curl do?

transfer data to or from a URL.

▸ Explain your own curl command →

curl examples, explained

$ curl -sSL -o out.html https://example.com

  • curltransfer data to or from a URL
  • -ssilent — hide the progress meter and errors
  • -Swith -s, still show errors
  • -Lfollow HTTP redirects
  • -owrite output to the given file
  • out.htmlvalue for -o
  • https://example.coman argument passed to the command

$ curl -X POST -H 'A: b' -d data url

  • curltransfer data to or from a URL
  • -Xset the HTTP request method (e.g. POST)
  • POSTvalue for -X
  • -Hadd a request header
  • A: bvalue for -H
  • -dsend the given data in a POST body
  • datavalue for -d
  • urlan argument passed to the command

curl flags & options

-ssilent — hide the progress meter and errors
-Swith -s, still show errors
-Lfollow HTTP redirects
-owrite output to the given file
-Osave output using the remote file name
-Xset the HTTP request method (e.g. POST)
-Hadd a request header
-dsend the given data in a POST body
-Fsend a multipart/form-data field
-ffail silently on server errors (no error page)
-kallow insecure TLS connections
-iinclude the response headers in the output
-Ifetch only the response headers (HEAD request)
-usupply user:password credentials
-Aset the User-Agent header
-bsend cookies (string or file)
--silenthide the progress meter
--locationfollow HTTP redirects
--outputwrite output to the given file
--headeradd a request header
--requestset the HTTP request method
--datasend the given data in a POST body
--failfail silently on server errors

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.