curl-library
Re: Content-Lenght in HTTP Header
Date: Tue, 14 Nov 2006 18:25:40 +0100 (CET)
On Tue, 14 Nov 2006, Roberto Curti wrote:
> POST / HTTP/1.1
> Content-Lenght: 491
> Content-Length: 491
> The Headers are sent correctly (also the body), but you can note that the
> Content-Length field was sent twice.
Eh, no. There's one Content-Lenght and one Content-Length...
> This is a problem because the server discards the request. The Header has to
> be sent exactly in the format above listed.
? Sure you mean it should be sent like that, but without the extra bad header?
So why do you add that one?
> headers = curl_slist_append(headers, "Content-Lenght: 300);
Skip this.
> headers = curl_slist_append(headers, "Host: 999.999.999.999:1111");
Skip this.
> headers = curl_slist_append(headers, "Connection: keep-alive");
Are you sure this is necessary? HTTP 1.1 is persistent by default.
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.htmlReceived on 2006-11-14