On 2/3/20 4:08 PM, Peng Yu wrote: > Hi, > > I'd like to understand the following two commands. One uses GET, the > other uses HEAD. > > wget -q -O /dev/null -S -o- URL > wget -q --spider -S -o- URL > > Is there first still download response body? Does wget know that its > /dev/null so that it just download the header and ignore the response > body?
/dev/null is often used for benchmarking and tests. So we don't use HEAD in this case. > If I only want the reponse header, and GET and HEAD result in the same > header for my purpose, I should use the 2nd one to save time as it > does not have response body? Yes, the second just does a HEAD request, so no body/data is sent in the response. Tim
signature.asc
Description: OpenPGP digital signature