I want to get the headers only from a curl request
curl -I www.google.com
All grand. Now I want to do that but to pass in post data too:
curl -I -d'test=test' www.google.com
But all I get is:
Warning: You can only select one HTTP request!
Anyone have any idea how to do this or am I doing something stupid?
The
-Ioption tells curl to do a HEAD request while the-d'test=test'option tells curl to do a POST, so you’re telling curl to do two different request types.or, on Windows:
That is the neatest way to do this as far as I can find. The options are:
-D-Dump the header to the file listed, or stdout when-is passed, like this.-o/dev/nullSend the body to the file listed. Here, we discard the body so we only see the headers.-sSilent (no progress bar)