bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] Syntax for RESTful scripting options


From: Hrvoje Niksic
Subject: Re: [Bug-wget] Syntax for RESTful scripting options
Date: Fri, 08 Mar 2013 00:42:17 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Tim Ruehsen <address@hidden> writes:

> BTW:
> How can Wget create a POST without any data (without Content-Type and Content-
> Length) ? Curl can...

If by "without any data" you mean with empty POST data, use
`--post-data=""'.  But that will send 0 Content-Length and the usual
Content-Type.  As always, you can customize both headers using the
`--header' option, but I don't think you can remove them entirely.

Maybe the `--header' syntax could be extended so that `--header=NAME'
(note lack of trailing colon -- currently illegal) could be used to
delete the generated header from the HTTP request.

> resulting request:
> POST /xxx HTTP/1.1
> User-Agent: Wget/1.14 (linux-gnu)
> Accept: */*
> Host: localhost:8000
> Connection: Keep-Alive
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 0
>
>
> OT (I just see it): Why does Wget send 'Connection: Keep-Alive' here ?
> It is not needed and causes unecessary impact on the server...

Because Wget tries to reuse the same connection for multiple requests.
For example, the server can respond with a redirection, which would
require a new request, best carried out on the same connection.  (Plus,
the code at that point doesn't have the information that it is the last
request that will be run.)



reply via email to

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