curl commands
21 commands, each with a one-line explanation. Click a command to copy it, or its title for details.
Commands 21 shown
-
curl -s -X POST https://api.example.com/v1/resource -H 'Content-Type: application/json' -H 'Authorization: Bearer <token>' -d '{"key":"value"}' | jq .Send a JSON POST request with Bearer auth
-
curl -sLv https://example.com 2>&1 | grep -E '^[<>*]'Show full request/response headers including redirects
-
curl -so /dev/null -w 'DNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n' https://example.comMeasure DNS, connect, and TTFB timing
-
curl -L --progress-bar -o output.file https://example.com/file.tar.gzDownload a file showing a clean progress bar
-
curl -s -u user:password https://api.example.com/endpoint | jq .HTTP request with Basic Authentication
-
curl -so /dev/null -w '%{http_code}' https://example.comGet just the response status code — useful in scripts
-
curl -X POST https://api.example.com/v1/items -H 'Content-Type: application/json' -d '{"name":"foo"}'Send JSON payload via POST
-
curl -H 'Authorization: Bearer $TOKEN' https://api.example.com/meAttach JWT/Bearer token in Authorization header
-
curl -Lv --max-redirs 5 https://example.comFollow up to 5 redirects and show full request/response
-
curl -sSL -o /tmp/result.json https://api.example.com/dataDownload silently, fail on error, follow redirects
-
curl -o /dev/null -sS -w 'ttfb: %{time_starttransfer}s\ntotal: %{time_total}s\n' https://example.comBenchmark TTFB and total request time
-
curl -sI https://example.comPrint HTTP response headers without body
-
curl -F 'file=@./report.pdf' -F 'user=alice' https://upload.example.com/apiMultipart form-data upload with extra fields
-
curl --http2 -sI https://example.com | grep -i 'http\|alt-svc'Force HTTP/2 and check protocol in response
-
curl --resolve example.com:443:1.2.3.4 https://example.comOverride DNS for a host:port pair (test behind CDN/LB)
-
curl --retry 5 --retry-delay 2 --retry-all-errors https://api.example.com/healthzRetry up to 5 times with 2s delay on any error
-
curl -d 'user=alice&pass=secret' -X POST https://auth.example.com/loginSend URL-encoded form data
-
curl --cert client.crt --key client.key --cacert ca.crt https://secure.example.commTLS request with client cert and custom CA
-
cat urls.txt | xargs -P 5 -I{} curl -sSL -o /dev/null -w '%{url_effective} %{http_code}\n' {}Download 5 URLs in parallel and print status codes
-
curl -i -N -H 'Upgrade: websocket' -H 'Connection: Upgrade' -H 'Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw==' -H 'Sec-WebSocket-Version: 13' http://localhost:8080/wsVerify WebSocket upgrade handshake responds with 101
-
curl --limit-rate 1M -O https://example.com/bigfile.isoLimit download bandwidth to 1 MB/s
no commands match — try a different search