Bearer token auth

Attach JWT/Bearer token in Authorization header

curl -H 'Authorization: Bearer $TOKEN' https://api.example.com/me

tool
curl21 commands
tags
curlsecurity

More curl commands

  • curl -Lv --max-redirs 5 https://example.com

    Follow up to 5 redirects and show full request/response

  • curl -sSL -o /tmp/result.json https://api.example.com/data

    Download silently, fail on error, follow redirects

  • curl -o /dev/null -sS -w 'ttfb: %{time_starttransfer}s\ntotal: %{time_total}s\n' https://example.com

    Benchmark TTFB and total request time

  • curl -sI https://example.com

    Print HTTP response headers without body

  • curl -F 'file=@./report.pdf' -F 'user=alice' https://upload.example.com/api

    Multipart form-data upload with extra fields

all 21 curl commands