hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <be...@u.washington.edu>
Subject Re: HTTP Version Not Supported Error
Date Mon, 18 Oct 2004 15:10:48 GMT
Hi Nick,

I have one addition to Roland's comments.

> b) Don't call setContentLength, or set it to -1 in a
> FilePart object. This should work fine with HTTP/1.1
> and chunked encoding, but also with HTTP/1.0 and
> no chunked encoding. Since the server does not know
> the content length in advance, it has to read until the
> end of the stream in no-chunks mode. Connection
> re-use is impossible, but after transferring more than
> 2 gigs I doubt you'll notice the performance impact
> of opening a new connection :-)
> It might be a violation of HTTP to POST data without
> a valid content length, but since you're controlling
> the server as well, that shouldn't bother you much.

The HttpClient 2.0 API does not directly support setting content length 
 > 2GB because of the use of an int.  This has been fixed in the 3.0 API 
but it can be done in 2.0 by setting the content-length header manually:

method.setRequestHeader("Content-Length", "Some number bigger than 2GB");

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Mime
View raw message