Time a request

Measure DNS, connect, and TTFB timing

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

tool
curl21 commands
tags
curlnetworkdebug

More curl commands

  • curl -L --progress-bar -o output.file https://example.com/file.tar.gz

    Download a file showing a clean progress bar

  • curl -s -u user:password https://api.example.com/endpoint | jq .

    HTTP request with Basic Authentication

  • curl -so /dev/null -w '%{http_code}' https://example.com

    Get just the response status code — useful in scripts

  • curl -X POST https://api.example.com/v1/items -H 'Content-Type: application/json' -d '{"name":"foo"}'

    Send JSON payload via POST

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

    Attach JWT/Bearer token in Authorization header

all 21 curl commands