commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Geisser <oliver.geis...@gmx.de>
Subject Re: PutMethod with chunked transfer
Date Fri, 08 Aug 2003 18:04:14 GMT
Hi

Andreas Probst wrote:
> Hi,
> 
> I found the solution, when I debugged through the code again:
> 
> To run unbuffered, ie. streamed, set requestContentLength to -1 
> or the real content length. -1 means chunked. If it isn't set by 
> the caller, it's set to -2 by default, which results i running 
> buffered.
> 
> The code now looks like:
> 
> putMethod.setRequestBody(inputStream);
> putMethod.setRequestContentLength(...);
> _jakartaHttpClient.executeMethod(putMethod);
[...]

Exactly, but you should use constant definitions and not
hardcoded number values. Use:

putMethod.setRequestContentLength(PutMethod.CONTENT_LENGTH_CHUNKED);

Olli

--og



Mime
View raw message