cURL to show response headers after submiting a file

curl

Solution

Use `-i`

From the cURL manual

 -i, --include       Include protocol headers in the output (H/F)

Note also:

-I, --head          Show document info only

The first will show headers, followed by body. The second will send a HEAD request so can't be used in your example as you're POSTing data.

Edit

The header output using `-i` is echoed to stdout, the same as the request body so directing the response into a PDF file will create an invalid PDF.

So I suggest instead you use `-v` which will be much noisier, but will show headers on command line when directing stdout to file, because verbose output goes to stderr.

Problem

I post file to url and would like to read all headers output in curl console. What parameter should I add? ``` curl -F file=@"c:\Word.docx" http://do.convertapi.com/Word2Pdf > output.pdf ```

Original source