3 ms·
That also causes curl to change the underlying request to a HEAD request. Though according to the spec they should return the same headers, it’s not uncommon fo
by johncolanduoni 6y ago
That also causes curl to change the underlying request to a HEAD request. Though according to the spec they should return the same headers, it’s not uncommon for sites to fail to do so (some web frameworks leave this responsibility to the user) or to cache these responses differently.
Personally I reflexively use the verbose version they used for these kind of investigations of server behavior after being bit a few times.
- StavrosK 6y agoSame here, I thought it caused cURL to do a GET request and throw away the body, but it doesn't, and I've gotten different results more than once.
- johnvaluk 6y agoAlso consider changing the user-agent from the default. I set mine to a typical browser string in ~/.curlrc, but you can also use -A/--user-agent on the command line.
- iampims 6y agocurl -i (lowercase) prints the headers as well as the response body without the verbosity of -v
- nerdponx 6y agoI believe you can also control what exactly is emitted with -w, which is nicer than trying to parse it later.
- nerdponx 6y agoI use -i instead of -v -o /dev/null; is there any reason to prefer the latter? Is Curl smart enough to skip fetching the response body with the latter?