POST JSON payload curl
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 .
more curl
all 21 commands →
Follow redirects with verbose
curl -sLv https://example.com 2>&1 | grep -E '^[<>*]'
Time a request
curl -so /dev/null -w 'DNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n' https://example.com
Download with progress
curl -L --progress-bar -o output.file https://example.com/file.tar.gz
Basic auth request
curl -s -u user:password https://api.example.com/endpoint | jq .
Check only HTTP status code
curl -so /dev/null -w '%{http_code}' https://example.com