abc abc - 1 month ago 4
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


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: