[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: wget GET vs HEAD
From: |
Tim Rühsen |
Subject: |
Re: wget GET vs HEAD |
Date: |
Mon, 3 Feb 2020 16:14:12 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 |
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