Re: [Bug-wget] Does `wget -q -O /dev/null -S -o- url` ignore response body?
That is precisely what the `--spider` option does. It sends a HEAD request. Just like the similarly named option in Curl. If you want it to be more explicit, you can use `--method=HEAD` instead. It will still do the same thing though. * Peng Yu [190812 20:56]: > curl has the --head option. Is there a reason why wget doesn't have it? > >-I, --head > (HTTP FTP FILE) Fetch the headers only! HTTP-servers > feature the command HEAD which this uses to get nothing but the header > of a document. When used on an > FTP or FILE file, curl displays the file size and last > modification time only. > > On 8/9/19, Tim Rühsen wrote: > > On 09.08.19 18:06, Peng Yu wrote: > >> Hi, > >> > >> I just want to retrieve the response header instead of the response body.. > >> > >> Does `wget -q -O /dev/null -S -o- url` still download the response > >> body, but then dump it to /dev/null? Or wget is smart enough to know > >> the destination is /dev/null so that it will not download the response > >> body at all? Thanks. > > > > /dev/null is just a another file. > > > > Try with --spider. It will send a HEAD request instead of a GET request > > - thus no body is downloaded. The server just serves the header as if it > > was a GET request. > > > > Regards, Tim > > > > > > > -- > Regards, > Peng > > -- Thanking You, Darshit Shah PGP Fingerprint: 7845 120B 07CB D8D6 ECE5 FF2B 2A17 43ED A91A 35B6 signature.asc Description: PGP signature
Re: [Bug-wget] Does `wget -q -O /dev/null -S -o- url` ignore response body?
curl has the --head option. Is there a reason why wget doesn't have it? -I, --head (HTTP FTP FILE) Fetch the headers only! HTTP-servers feature the command HEAD which this uses to get nothing but the header of a document. When used on an FTP or FILE file, curl displays the file size and last modification time only. On 8/9/19, Tim Rühsen wrote: > On 09.08.19 18:06, Peng Yu wrote: >> Hi, >> >> I just want to retrieve the response header instead of the response body. >> >> Does `wget -q -O /dev/null -S -o- url` still download the response >> body, but then dump it to /dev/null? Or wget is smart enough to know >> the destination is /dev/null so that it will not download the response >> body at all? Thanks. > > /dev/null is just a another file. > > Try with --spider. It will send a HEAD request instead of a GET request > - thus no body is downloaded. The server just serves the header as if it > was a GET request. > > Regards, Tim > > -- Regards, Peng
Re: [Bug-wget] Does `wget -q -O /dev/null -S -o- url` ignore response body?
On 09.08.19 18:06, Peng Yu wrote: > Hi, > > I just want to retrieve the response header instead of the response body. > > Does `wget -q -O /dev/null -S -o- url` still download the response > body, but then dump it to /dev/null? Or wget is smart enough to know > the destination is /dev/null so that it will not download the response > body at all? Thanks. /dev/null is just a another file. Try with --spider. It will send a HEAD request instead of a GET request - thus no body is downloaded. The server just serves the header as if it was a GET request. Regards, Tim signature.asc Description: OpenPGP digital signature
[Bug-wget] Does `wget -q -O /dev/null -S -o- url` ignore response body?
Hi, I just want to retrieve the response header instead of the response body. Does `wget -q -O /dev/null -S -o- url` still download the response body, but then dump it to /dev/null? Or wget is smart enough to know the destination is /dev/null so that it will not download the response body at all? Thanks. -- Regards, Peng