On Mon, 2011-03-21 at 18:34 -0500, hanasaki wrote:
> Using http client 4.1 with an http put and a route through a squid proxy 
> to a basic-authentication http server.  Not proxy auth in this case. 
> The file upload is going through chunked dispite setting chunking off. 
> I used the below example with POST as a template for the client code and 
> set chunking to false.  The PUT is going up as chunked.  This was 
> verified with wireshark capturing the "not supported" coming back from 
> squid (2.x) as well as decoding the http PUT that went to squid.
> 
> http://hc.apache.org/httpcomponents-client-ga/examples.html
> http://www.innovation.ch/java/HTTPClient/advanced_info.html
> 
> ref:
>              reqEntity.setChunked(true); <= I set to FALSE
> ...
>              httppost.setEntity(reqEntity);
> 

If the entity's content length is not known (set to -1) HttpClient has
no other choice but to use chunk coding.

When sending requests via an HTTP/1.0 proxy such as squid 2.x make sure
to configure HttpClient to use HTTP/1.0. This will automatically disable
content chunking.

Oleg 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to