POST JSON payload
Send a JSON POST request with Bearer auth
curl -s -X POST https://api.example.com/v1/resource -H 'Content-Type: application/json' -H 'Authorization: Bearer <token>' -d '{"key":"value"}' | jq .
- tool
- curl21 commands
More curl commands
-
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