abc abc -4 years ago 306
Linux Question

curl usage to get header

Why does this not work:

curl -X HEAD

But these both work just fine:

curl -I

curl -X GET

Answer Source

You need to add the -i flag to the first command, to include the HTTP header in the output. This is required to print headers.

curl -X HEAD -i

More here:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download