bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #56808] wget uses HEAD method when both --spider and --post-data op


From: Sergey Ponomarev
Subject: [bug #56808] wget uses HEAD method when both --spider and --post-data options are used
Date: Sun, 8 May 2022 10:38:56 -0400 (EDT)

Follow-up Comment #3, bug #56808 (project wget):

The spider has two components:
1. Send a HEAD (and repeat with GET)
2. Ignore response

The 1 can be replaced with a direct --method=HEAD
Repeat functionality is doubtful: all webservers supports the HEAD.
Only some APIs that generates a response may not support the HEAD.
But a GET response to them would be an overkill because the response
generation may be heavy.

The 2 is actually a useful thing e.g. you just want to send a request but not
interested in the response to keep resources.
This would be better than output to /dev/null because wget can close the
connection instead of a full download.

I think that a proper solution would be to allow mutual usage of the spider
with all other options:
1. If the --method specified use it but ignore response.
2. If specified --post-data or --post-file then send a POST as usual but again
ignore the response.
3. If none of the above is specified then make HEAD and then GET but discard
response as usual.

The --content-on-error option should disable the response discarding.

This will make the logic plain and backward compatible.

Currently I'm working on the BusyBox wget clone and to keep logic simple and
plain and code small this is a best option.
It would be great if GNU wget will work like that.
Even simple error message about spider and post-data conflict takes a space
precious for embedded devices.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56808>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]