Check only HTTP status code curl
Get just the response status code — useful in scripts
curl -so /dev/null -w '%{http_code}' https://example.com
more curl
all 21 commands →
POST JSON body
curl -X POST https://api.example.com/v1/items -H 'Content-Type: application/json' -d '{"name":"foo"}'
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