cURL suppress response body

BaltoStar picture BaltoStar · Sep 9, 2015 · Viewed 82.3k times · Source

Is it possible instruct cURL to suppress output of response body?

In my case, the response body is an HTML page, which overflows the CLI buffer, making it difficult to find the relevant information. I want to examine the other parts of the output such as HTTP response code, headers, e.t.c. - everything except the actual HTML.

Answer

Gilles Quenot picture Gilles Quenot · Sep 9, 2015

You can use the -o switch and null pseudo-file :

Unix

curl -s -o /dev/null -v http://google.com

Windows

curl -s -o nul -v http://google.com