abc abc - 1 year ago 114
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: