curl
Debugging
Trace requests, timing, and transfers.
By EZ4Code Team
debugtracetiming
Code
# Verbose: headers, TLS handshake, redirects
curl -v https://example.com
# Full trace with hex dump
curl --trace - https://example.com
# Trace only timing, no body
curl -w "DNS:%{time_namelookup} CONNECT:%{time_connect} TOTAL:%{time_total}\n" \
-o /dev/null -s https://example.com
# Measure download speed and size
curl -o /dev/null -s -w "Size: %{size_download} bytes Speed: %{speed_download} bps\n" \
https://example.com/bigfileExplanation
The -v flag prints connection details including headers in both directions, while --trace produces a hex dump of all traffic. The -w option formats custom output using variables like time_connect and speed_download, perfect for benchmarking. Combine with -s -o /dev/null to suppress the body when you only want metrics.