-X
or --request
command-line options followed by the actual method name. You can, for example, send a DELETE
instead of GET
like this:-X
, as HEAD is specified to send all the headers a GET response would get but never send a response body, even if the headers otherwise imply that one would come. So, adding -X HEAD
to a command line that would otherwise do a GET will cause curl to hang, waiting for a response body that will not come.-X
. It should also be noted that when curl follows redirects like asked to with -L
, the request method set with -X
will be sent even on the subsequent redirects.