curl https://example.com | Simple GET request |
curl -o file.html https://example.com | Save output to file |
curl -O https://example.com/file.zip | Save with remote filename |
curl -L https://example.com | Follow redirects |
curl -I https://example.com | Get headers only (HEAD) |
curl -i https://example.com | Include headers in output |
curl -v https://example.com | Verbose output |
curl -s https://example.com | Silent mode |
curl -sS https://example.com | Silent but show errors |
curl -X POST https://example.com | Simple POST |
curl -d "data" https://example.com | POST with data |
curl -d "name=value&foo=bar" https://example.com | Form data |
curl -d @file.txt https://example.com | POST data from file |
curl --data-urlencode "q=hello world" https://example.com | URL-encode data |
curl -X PUT -d "data" https://example.com | PUT request |
curl -X DELETE https://example.com/item/1 | DELETE request |
curl -X PATCH -d "data" https://example.com | PATCH request |
curl -X OPTIONS https://example.com | OPTIONS request |
curl -H "Content-Type: application/json" https://example.com | Set content type |
curl -H "Accept: application/json" https://example.com | Set accept header |
curl -H "X-Custom: value" https://example.com | Custom header |
curl -H "Header1: val1" -H "Header2: val2" https://example.com | Multiple headers |
curl -A "Mozilla/5.0" https://example.com | Set User-Agent |
curl -e "https://referrer.com" https://example.com | Set Referer |
curl -u user:pass https://example.com | Basic auth |
curl -u user https://example.com | Basic auth (prompt pass) |
curl -H "Authorization: Bearer TOKEN" https://example.com | Bearer token |
curl --oauth2-bearer TOKEN https://example.com | OAuth2 bearer |
curl --digest -u user:pass https://example.com | Digest auth |
curl --ntlm -u user:pass https://example.com | NTLM auth |
curl -n https://example.com | Use .netrc for auth |
curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' https://api.example.com | POST JSON |
curl -X PUT -H "Content-Type: application/json" -d @data.json https://api.example.com | PUT JSON from file |
curl https://api.example.com | jq . | Format JSON with jq |
curl -s https://api.example.com | jq '.data[]' | Extract JSON field |
curl "https://api.example.com?page=1&limit=10" | Query parameters |
curl -G -d "page=1" -d "limit=10" https://api.example.com | Build query string |
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer TOKEN" \
-d '{"title":"Test"}' \
https://api.example.com/posts | Full API call |
curl -F "file=@photo.jpg" https://example.com/upload | Upload file |
curl -F "file=@photo.jpg;type=image/jpeg" https://example.com/upload | Upload with MIME type |
curl -F "file=@photo.jpg" -F "name=value" https://example.com | File with form fields |
curl -F "files[]=@file1.txt" -F "files[]=@file2.txt" https://example.com | Multiple files |
curl -F "file=@-" https://example.com < file.txt | Upload from stdin |
curl -O https://example.com/file.zip | Download with original name |
curl -o custom.zip https://example.com/file.zip | Download with custom name |
curl -C - -O https://example.com/large.zip | Resume download |
curl -# -O https://example.com/file.zip | Progress bar |
curl --limit-rate 1M -O https://example.com/file.zip | Limit download speed |
curl -O https://example.com/file[1-10].jpg | Download range of files |
curl -b "name=value" https://example.com | Send cookie |
curl -b cookies.txt https://example.com | Send cookies from file |
curl -c cookies.txt https://example.com | Save cookies to file |
curl -b cookies.txt -c cookies.txt https://example.com | Read and update cookies |
curl -b "" https://example.com | Enable cookie engine |
curl -c session.txt -d "user=admin&pass=secret" https://example.com/login | Login and save session |
curl -b session.txt https://example.com/dashboard | Access with session |
curl -k https://example.com | Skip SSL verification |
curl --cacert ca.crt https://example.com | Use custom CA cert |
curl --cert client.crt --key client.key https://example.com | Client certificate |
curl --tlsv1.2 https://example.com | Force TLS 1.2 |
curl --tlsv1.3 https://example.com | Force TLS 1.3 |
curl -w "%{ssl_verify_result}" https://example.com | Show SSL verify result |
curl -x http://proxy:8080 https://example.com | HTTP proxy |
curl -x socks5://proxy:1080 https://example.com | SOCKS5 proxy |
curl -U user:pass -x http://proxy:8080 https://example.com | Proxy with auth |
curl --noproxy "localhost,*.local" https://example.com | Bypass proxy |
export http_proxy=http://proxy:8080 | Set proxy env var |
curl -w "Time: %{time_total}s\n" https://example.com | Show request time |
curl -w "DNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n" https://example.com | Detailed timing |
curl -w "%{http_code}" -o /dev/null -s https://example.com | Get status code only |
curl -w "%{size_download} bytes" https://example.com | Show download size |
curl --trace trace.log https://example.com | Full trace to file |
curl --trace-ascii - https://example.com | ASCII trace to stdout |
curl --connect-timeout 5 https://example.com | Connection timeout |
curl -m 30 https://example.com | Max time (total) |
curl --retry 3 https://example.com | Retry on failure |
curl --retry 3 --retry-delay 5 https://example.com | Retry with delay |
curl --retry-all-errors https://example.com | Retry all errors |
curl --compressed https://example.com | Request compression |
curl --http2 https://example.com | Use HTTP/2 |
curl --http3 https://example.com | Use HTTP/3 |
curl --resolve example.com:443:127.0.0.1 https://example.com | Override DNS |
curl -4 https://example.com | Force IPv4 |
curl -6 https://example.com | Force IPv6 |