On Mon, May 20, 2013 at 09:49:32AM -0400, David Motes wrote:
> Use the setChunked method on the entity which defines the content.
> There is a content size limit of around 2GB if you do not use chunked
> transfer.
> 
> DefaultHttpClient cli = new DefaultHttpClient();
> HttpPut method  = new HttpPut(url);
> InputStreamEntity reqEntity = new InputStreamEntity(pmis, -1);
> reqEntity.setContentType("application/octet-stream");
>  reqEntity.setChunked(false);
> 
>  method.setEntity(reqEntity);
> resp = cli.execute(method);
> 
> 

Alternatively, one can make HttpClient use HTTP/1.0, which will automatically 
disable chunk content coding.

Oleg


> On Sun, May 19, 2013 at 5:19 PM, Tony Anecito <[email protected]> wrote:
> 
> > Hi All,
> >
> > I recently upgraded from http client 3.1 to 4.2.5 and discovered that some
> > http proxies (earlier version squid proxy does not supported it) will not
> > work with 4.2.5 due to not supporting chunked encoding.
> >
> > So for now how do I tell 4.2.5 not to use chunked encoding? I do not have
> > control over proxies to get them to upgrade that do not support chunked
> > encoding.
> >
> > Thanks,
> > -Tony

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

Reply via email to