How to Display curl request headers in cURL Command
To display curl request headers we need to use the -v option (verbose).
curl -v example.com
The cURL verbose option includes both request headers and response headers. Lines starting with '>' are the request headers or header data sent by curl.
We can use the grep command to filter lines start with '>' character and display only the curl request headers.
curl -v example.com 2>&1 | grep '^>'