Tim Ruehsen <[email protected]> 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.)
