Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] How to turn off Transfer-Encoding: Chunked when sending with jetty client

Hi,

On Mon, Nov 16, 2015 at 2:04 PM, Tuomas Kiviaho <tuomas.kiviaho@xxxxxx> wrote:
> Hi,
>
> Is there a way to turn off chunking when sending with jetty client.
> HttpConnection.normalizeRequest contains a section where chunked transfer
> encoding is enforced when content provider length is not specified.
>
> If I skip the normalization then the
> HttpGenerator.generateRequest->generateHeaders insist on falling back to
> chunked encoding because Connection: close doesn't avoid this fall back
> procedure because response(?) is missing. I just set end-of-content despite
> missing response (it's request after all that I'm generating) then the
> connection is (eventually) marked as non-persistent and chunking is avoided.

I don't understand, sorry.

If you want to avoid chunking, just specify the Content-Length.

If you don't have the content length, and you want to force the
request content to be delimited by the connection close, just use
HTTP/1.0 rather than 1.1.

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.


Back to the top