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
163
votes
43 answers

Chrome net::ERR_INCOMPLETE_CHUNKED_ENCODING error

For the past two months, I have been receiving the following error on Chrome's developer console: net::ERR_INCOMPLETE_CHUNKED_ENCODING Symptoms: Pages not loading. Truncated CSS and JS files. Pages hanging. Server environment: Apache…
Wayne Whitty
  • 19,513
  • 7
  • 44
  • 66
49
votes
3 answers

Content-Length header versus chunked encoding

I'm trying to weigh the pros and cons of setting the Content-Length HTTP header versus using chunked encoding to return [possibly] large files from my server. One or the other is needed to be compliant with HTTP 1.1 specs using persistent…
Gandalf
  • 9,648
  • 8
  • 53
  • 88
41
votes
3 answers

gzip compression of chunked encoding response?

I'm trying to get my webserver to correctly gzip an http response that is chunk encoding. my understanding of the non-gzip response is that it looks like this: and then for each chunk,
Heinrich Schmetterling
  • 6,614
  • 11
  • 40
  • 56
40
votes
1 answer

Restlet, CLAP, Ajax, and chunk timeouts

We're using RESTlet to do a small little REST server for a project we have. We set up a bunch of routes in a class inheriting from Application: public static void createRestServer(ApplicationContext appCtx, String propertiesPath) throws Exception…
MarcWan
  • 2,943
  • 3
  • 28
  • 41
33
votes
3 answers

HTTP Chunked Encoding. Need an example of 'Trailer' mentioned in SPEC

I am writing an HTTP parser for a transparent proxy. What is stumping me is the Trailer: mentioned in the specs for Transfer-Encoding: chunked. What does it look like? Normally, a HTTP chunked ends like this. 0\r\n \r\n What I am confused about is…
unixman83
  • 9,421
  • 10
  • 68
  • 102
33
votes
9 answers

How to make PHP generate Chunked response

I googled for this problem but there is no answer for it. I want my PHP script to generate HTTP response in chunked( http://en.wikipedia.org/wiki/Chunked_transfer_encoding). How to do it? Update: I figured it out. I have to specify Transfer-encoding…
Morgan Cheng
  • 73,950
  • 66
  • 171
  • 230
33
votes
5 answers

Do any browsers support trailers sent in chunked encoding responses?

HTTP/1.1 specifies that a response sent as Transfer-Encoding: chunked can include optional trailers (ie. what would normally be sent as headers, but for whatever reason can't be calculated before the content, so they can be appended to the end), for…
Scott
  • 1,518
  • 1
  • 15
  • 23
27
votes
2 answers

POST request to PHP7 with chunked encoding does not properly return result

I'm sending a POST request from a client (tested with curl and custom nodejs script) and don't get the response properly back. The whole thing works fine with PHP 5.6. Environment The whole thing is reduced as much as possible: everything running…
mark
  • 6,308
  • 8
  • 46
  • 57
26
votes
2 answers

Difference between multipart and chunked protocol?

Can some experts explain the differences between the two? Is it true that chunked is a streaming protocol and multipart is not? What is the benefit of using multipart?
user776635
  • 861
  • 3
  • 9
  • 13
26
votes
2 answers

How do I receive a file upload in spring mvc using both multipart/form and chunked encoding?

I am trying to write a spring mvc method that can receive either a multipart/form or transfer-encoding chunked file upload. I can write a separate method to handle each type but I'd like to do it with the same method so i can use the same REST POST…
Steve L
  • 783
  • 3
  • 8
  • 15
19
votes
3 answers

Python Requests - ChunkedEncodingError(e) - requests.iter_lines

I'm getting a ChunkedEncodingError(e) using Python requests. I'm using the following to rip down JSON: r = requests.get(url, headers=auth, stream=True) And the iterating over each line, using the carriage return as a delimiter, which is how this…
HectorOfTroy407
  • 1,737
  • 5
  • 21
  • 31
18
votes
2 answers

Using "transfer-encoding: chunked", how much data must be sent before browsers start rendering it?

All browsers wait for some content (and sometimes some amount of time, too) before they start rendering a partial http response you have flushed to it across the network - but how much?
ecmanaut
  • 5,030
  • 2
  • 44
  • 66
17
votes
1 answer

Are multiple responses legal in HTTP?

I'm a bit rusty on nuances of the HTTP protocol and I'm wondering if it can support publish/subscribe directly? HTTP is a request reponse protocol. So client sends a request and the server sends back a response. In HTTP 1.0 a new connection was made…
Bruce Adams
  • 4,953
  • 4
  • 48
  • 111
17
votes
2 answers

How should an HTTP client properly parse *chunked* HTTP response body?

When chunked HTTP transfer encoding is used, why does the server need to write out both the chunk size in bytes and have the subsequent chunk data end with CRLF? Doesn't this make sending binary data "CRLF-unclean" and the method a bit redundant?…
Armen Michaeli
  • 8,625
  • 8
  • 58
  • 95
16
votes
1 answer

c# Chunked transfer of file upload in combination with access to route parameters in ServiceStack

I'm looking to use the IRequiresRequestStream interface to enable large file uploads (video files) using ServiceStack (v3) and chunked transfer encoding. The standard file upload can't seem to cope with some of the larger video files our customers…
Rebecca
  • 13,914
  • 10
  • 95
  • 136
1
2 3
28 29