POST JSON body curl
Send JSON payload via POST
curl -X POST https://api.example.com/v1/items -H 'Content-Type: application/json' -d '{"name":"foo"}'
more curl
all 21 commands →
Bearer token auth
curl -H 'Authorization: Bearer $TOKEN' https://api.example.com/me
Follow redirects with verbose
curl -Lv --max-redirs 5 https://example.com
Save response to file
curl -sSL -o /tmp/result.json https://api.example.com/data
Measure time to first byte
curl -o /dev/null -sS -w 'ttfb: %{time_starttransfer}s\ntotal: %{time_total}s\n' https://example.com
Show response headers only
curl -sI https://example.com