Questions tagged [chunked-encoding]

Chunked encoding involves transferring the body of a message as a series of chunks, each with its own chunk size header.

This defined process means that an application-generated entity body, or a large entity body, can be sent in convenient segments. The client or server knows the chunked message is complete when the zero length chunk is received.

The body of a chunked message can be followed by an optional trailer that contains supplementary HTTP headers, known as trailing headers. Clients and servers are not required to accept trailers, so the supplementary HTTP headers should only provide non-essential information, unless a server knows that a client accepts trailers.

To use chunked transfer-coding, both the client and server must be using HTTP/1.1. A chunked message cannot be sent to an HTTP/1.0 client. The requirements that apply to chunked transfer-coding and the use of trailing headers are defined in the HTTP/1.1 specification

Source

421 questions
7
votes
0 answers

What's the trigger condition of Transfer-Encoding: chunked for Tomcat 8

Here is the configuration in the server.xml in my tomcat 8. and I just find that some RESTful api requests return with…
Yuwen Yan
  • 4,777
  • 10
  • 33
  • 63
7
votes
0 answers

Chunked request to undertow server causes hanging state

I have an Undertow server and am running the defaults. I am attempting to send a chunked request and while the server to receive the chunks, the input stream server side never reaches a -1 state and hangs. I have used the defaults for the Undertow…
js758
  • 71
  • 4
7
votes
5 answers

Why doesn't IIS support chunked transfer encoding?

I am making an HTTP connection to an IIS web server and sending a POST request with the data encoded using Transfer-Encoding: chunked. When I do this, IIS simply closes the connection, with no error message or status code. According to the HTTP 1.1…
Graeme Perrow
  • 56,086
  • 21
  • 82
  • 121
7
votes
3 answers

Java HTTP server sending chunked response

I am working on a Java application which has a built in HTTP server, at the moment the server is implemented using ServerSocketChannel, it listens on port 1694 for requests: msvrCh = ServerSocketChannel.open(); …
SPlatten
  • 5,334
  • 11
  • 57
  • 128
7
votes
1 answer

When does Rails respond with 'transfer-encoding' vs. 'content-length'?

I'm building an API on Rails version 4.1.7/Nginx that responds to request from an iOS app. We're seeing some weird caching on the client and we think it has something to do with a small difference in the response that Rails is sending back. My…
readyornot
  • 2,783
  • 2
  • 19
  • 31
7
votes
5 answers

HTTP Data chunks over multiple packets?

What is the correct way for a HTTP server to send data over multiple packets? For example I want to transfer a file, the first packet I send is: HTTP/1.1 200 OK Content-type: application/force-download Content-Type:…
myforwik
  • 195
  • 1
  • 2
  • 6
7
votes
2 answers

how to specify the chunk size in a chunked post using curl

I am trying to send audio to a webservice that want the audio as a chunked post. Sending pre-recorded files works fine, but running the below code does not send anything to the server as it seems. Is curl trying to send everything in one chunk? I…
ensonic
  • 3,304
  • 20
  • 31
7
votes
1 answer

avoiding chunked encoding of HTTP/1.1 response

I want to avoid ever getting chunked encoded HTTP server response from (conforming) HTTP server. I am reading RFC 2616 section "14.39 TE" and it seems to me that I could avoid it by specifying TE: chunked;q=0. If I cannot avoid the chunked encoding,…
wilx
  • 17,697
  • 6
  • 59
  • 114
7
votes
2 answers

HTTP Chunked transfer encoding: How do you send "\r\n"?

Say the body I'm trying to send via chunked encoding includes "\r\n", how do I avoid that being interpreted as the chunk delimeter? e.g. "All your base are\r\n belong to us" http://en.wikipedia.org/wiki/Chunked_transfer_encoding
waterlooalex
  • 13,642
  • 16
  • 78
  • 99
7
votes
1 answer

C# using WebClient to download chunked encoded content

I wrote a client application that is suppose to download a file from a web server, very simple: using (WebClient webClient = new WebClient()) { webClient.DownloadFile("http://localhost/audiotest/audio.wav", …
eddyuk
  • 4,110
  • 5
  • 37
  • 65
6
votes
1 answer

c#: Saving JPGs in parts

I am currently working on a c# open source photo mosaic software (Sourceforge Link). This software stitches together large amounts of small photos (tiles) into one big image. Since the final image size is usually in the order of 20k px times 15k px,…
mgulde
  • 215
  • 3
  • 10
6
votes
1 answer

How do I send Http trailers/footers in a chunked response from within a java servlet?

Basically my response headers contain Transfer-encoding=chunked, Trailer=[some trailer I want to send say e.g "SomeTrailer"] Once I'm done writing the data to the Servlet outputstream, I'm writing the trailer "SomeTrailer:[value]", but this is not…
RD.
  • 300
  • 4
  • 12
6
votes
1 answer

Receiving chunked data endlessly

As you might know for sending chunked file in HTTP header, there is no content length, so the program must wait for 0 to understand that file ended. --sample http header POST /some/path HTTP/1.1 Host: www.example.com Content-Type: text/plain …
arfo
  • 321
  • 2
  • 11
6
votes
1 answer

Ktor HttpClient Support for Chunked Transfer Encoding

I'm using the Ktor HttpClient(CIO) to make requests against an HTTP API whose response uses chunked transfer encoding. Is there a way using the Ktor HttpClient(CIO) to get access to the individual Http Chunks in an HttpResponse, when calling an API…
6
votes
3 answers

Webpack hmr net::ERR_INCOMPLETE_CHUNKED_ENCODING

When it loads everything is ok and hmr is working. Then this error is appearing. GET http://localhost:3000/__webpack_hmr net::ERR_INCOMPLETE_CHUNKED_ENCODING It's like the webpackdevserver is kinda crashing then relaunch, it takes few seconds then…
François Richard
  • 6,817
  • 10
  • 43
  • 78