Basic auth request curl
HTTP request with Basic Authentication
curl -s -u user:password https://api.example.com/endpoint | jq .
more curl
all 21 commands →
Check only HTTP status code
curl -so /dev/null -w '%{http_code}' https://example.com
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