curl Commands
curl commands cheatsheet.
Fetch URLs, post data, set headers and debug HTTP from the terminal — the curl flags you actually use. Tap to copy.
Fetching
curl https://example.comFetch a URL and print the responsecurl -O https://example.com/file.zipDownload and save with the remote filenamecurl -o out.html https://example.comDownload and save to a chosen filenamecurl -L https://example.comFollow redirects to the final URLcurl -I https://example.comFetch only the response headerscurl -s https://example.comSilent mode — hide the progress meterSending data
curl -X POST https://api.example.comMake a request with a specific methodcurl -d "name=ada&role=dev" URLSend form-encoded POST datacurl -H "Content-Type: application/json" -d '{"a":1}' URLSend a JSON request bodycurl -d @data.json URLSend the contents of a file as the bodycurl -F "file=@photo.png" URLUpload a file as multipart form dataHeaders & auth
curl -H "Authorization: Bearer TOKEN" URLSend a custom header (e.g. a bearer token)curl -u user:pass URLUse HTTP basic authenticationcurl --cookie "session=abc" URLSend a cookie with the requestcurl -A "MyAgent/1.0" URLSet a custom User-AgentDebugging
curl -v https://example.comVerbose output — show the full exchangecurl -w "%{http_code}\n" -o /dev/null -s URLPrint just the HTTP status codecurl --max-time 10 URLGive up after 10 secondscurl -k https://example.comSkip TLS certificate verification (insecure)The everyday HTTP tool
curl is how you talk to web servers and APIs from the command line. A bare curl URL prints a response; add -L to follow redirects, -I for just the headers, and -O to save a download. For APIs, -X sets the method, -d sends a body, and -H adds headers like an auth token. When something misbehaves, -v shows the entire request and response so you can see exactly what's happening.
FAQ
How do I send JSON with curl?
Set the content type and pass the body: curl -H "Content-Type: application/json" -d '{"key":"value"}' URL.
How do I download a file with curl?
Use curl -O URL to save it with its remote name, or curl -o name.ext URL to choose the filename. Add -L to follow redirects.
More cheatsheets
SSH & SCP commands →
Connect, keys, copy & tunnels
Linux commands →
Terminal, files, search & system
JWT decoder →
Decode JWT header & payload
Git commands →
Branches, commits, remotes & undo
jq commands →
Filter & transform JSON