Command line curl can display response header by using -D option, but I want to see what request header it is sending. How can I do that?
A popular answer for displaying response headers, but OP asked about request headers.
curl -s -D - -o /dev/null http://example.com
-s : Avoid showing progress bar-D - : Dump headers to a file, but - sends it to stdout-o /dev/null : Ignore response bodyThis is better than -I as it doesn't send a HEAD request, which can produce different results.
It's better than -v because you don't need so many hacks to un-verbose it.