The curl flags used day to day, grouped by job: shape the request, set headers, authenticate, present an identity, control output, follow redirects, tune the connection, and debug. Each row pairs the flag with a realistic invocation.
curl sends an HTTP request and prints the response body. Most of its power is in the flags: they choose the method, attach headers and data, handle auth, and decide what gets printed. The long form is shown where it is clearer; the short form is the single letter. Put URLs in quotes so the shell does not eat the query string.
Reference table · 54 entries
curl FlagsExplained
54 of 54 rows
Request shape
Set the HTTP method.
curl -X POST https://api.test
Add a request header.
curl -H "Accept: application/json" URL
Send a body (sets POST and a default content type).
curl -d "name=Ada" URL
Append -d values as query params onto a GET.
curl -G -d "q=hi" URL
Send multipart form data (file uploads).
curl -F "file=@photo.png" URL
Send form data with URL encoding applied.
curl --data-urlencode "name=Ada Lovelace" URL
Upload a file with PUT.
curl -T big.zip URL
Append an upload to the remote file instead of replacing it.