You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Tony Anecito <ad...@yahoo.com> on 2013/05/19 23:19:00 UTC

Truning off Chunked Encoding...

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

Re: Turning off Chunked Encoding...

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, May 20, 2013 at 08:21:56AM -0700, Tony Anecito wrote:
> Thanks David,
> 
> I am curious does anyone know if chunked encoding by default was enabled in httpclient sometime after httpclient 3.1? I see hints of it when I google.
> 
> Thanks,
> -Tony
> 
> 

Chunk content coding was always on since early 2.x versions. Support for chunk transfer encoding is mandated by the HTTP/1.1 spec.

Oleg

> 
> 
> ________________________________
>  From: David Motes <da...@gmail.com>
> To: HttpClient User Discussion <ht...@hc.apache.org>; Tony Anecito <ad...@yahoo.com> 
> Sent: Monday, May 20, 2013 7:49 AM
> Subject: Re: Truning off Chunked Encoding...
>  
> 
> 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);
> 
> 
> On Sun, May 19, 2013 at 5:19 PM, Tony Anecito <ad...@yahoo.com> 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: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Turning off Chunked Encoding...

Posted by Tony Anecito <ad...@yahoo.com>.
Thanks David,

I am curious does anyone know if chunked encoding by default was enabled in httpclient sometime after httpclient 3.1? I see hints of it when I google.

Thanks,
-Tony




________________________________
 From: David Motes <da...@gmail.com>
To: HttpClient User Discussion <ht...@hc.apache.org>; Tony Anecito <ad...@yahoo.com> 
Sent: Monday, May 20, 2013 7:49 AM
Subject: Re: Truning off Chunked Encoding...
 

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);


On Sun, May 19, 2013 at 5:19 PM, Tony Anecito <ad...@yahoo.com> 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

Re: Truning off Chunked Encoding...

Posted by Tony Anecito <ad...@yahoo.com>.
Thanks I realized that but was trying to avoid doing that. I will stick with latest HttpClient since most my users do not use a proxy and those corps who have http 1.1 issues and chuncked encoding will need to fix thier infrastructure.
 
Many Thanks,
-Tony

From: Oleg Kalnichevski <ol...@apache.org>
To: HttpClient User Discussion <ht...@hc.apache.org> 
Sent: Wednesday, May 22, 2013 1:58 AM
Subject: Re: Truning off Chunked Encoding...


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 <ad...@yahoo.com> 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: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

Re: Truning off Chunked Encoding...

Posted by Oleg Kalnichevski <ol...@apache.org>.
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 <ad...@yahoo.com> 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: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Truning off Chunked Encoding...

Posted by David Motes <da...@gmail.com>.
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);


On Sun, May 19, 2013 at 5:19 PM, Tony Anecito <ad...@yahoo.com> 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