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
4
votes
1 answer

CURL vs fsockopen chunking

This may seem kind of weird.. but I need to evaluate/parse chunks being sent over HTTP with PHP. It's of note to say that the HTTP stream may never end. Is there any way I can parse chunks as I get them with CURL? Or do I have to resort to some…
David Titarenco
  • 32,662
  • 13
  • 66
  • 111
4
votes
0 answers

Golang NewChunkedReader Usage

I'm attempting to process a chunked response from a 3rd-party service by introducing it to httputil.NewChunkedReader: chunkedReader := httputil.NewChunkedReader(chunkedResponse) buf := new(bytes.Buffer) buf.ReadFrom(chunkedReader) return…
Paul Mooney
  • 1,576
  • 12
  • 28
4
votes
2 answers

Parsing Chunked HTTP/1.1 Response

I just implemented a HTTP/1.1 client to parse the chunked transferring coding. However, it works for some websites but fails for others. I assume I need to read chunkSize + 2 bytes including \r\n for each chunk data, am I right? Here is my…
TonyLic
  • 647
  • 1
  • 13
  • 26
4
votes
1 answer

Can nginx send dynamically-gzipped content without using chunked encoding?

There's a server that sends responses to HTTP requests, and these responses have a Content-Length header, but the server is proxied through nginx, which is configured to gzip the responses so they're smaller, but also causes it to use chunked…
Avril
  • 813
  • 1
  • 9
  • 20
4
votes
1 answer

WebApi can't read chunked request

I am writing a web service that will be used to consume some data. The 3rd party that is sending it is using a multipart request and when I look at the request in WireShark, it is chunked. When I attempt to run the exact same request through…
Scottie
  • 11,050
  • 19
  • 68
  • 109
4
votes
1 answer

How to stop streamed Comet communications being buffered in the browser

I'm trying to push packets of data from my HTTP server to a browser, using a Comet "forever iframe" and feeding it script tags from the server using the Transfer-Encoding: chunked header. What I'm finding is that my script tags aren't being…
NeilDurant
  • 2,082
  • 2
  • 14
  • 14
4
votes
4 answers

CXF buffering data when using chunked encoding

I've written a java REST (streaming) servlet using Apache CXF 2.5.1 and deployed it to a Tomcat 7.0.42 container. The REST endpoint is essentially an implementation of StreamingOutput, wrapped it a Response object that is handed off to the container…
harumph
  • 195
  • 1
  • 11
4
votes
0 answers

Why is my Rails app using chunked transfer encoding?

I am not using stream anywhere in my app, but responses are still being sent with transfer-encoding: chunked additional mystery #1: the header is lowercase additional mystery #2: there is an etag, which by default in rails is calculated using the…
John Bachir
  • 22,495
  • 29
  • 154
  • 227
4
votes
0 answers

how to turned off chunked encoding?

I want to turn off chunked encoding in my IIS webserver so I can get the content length, and I had turned off the chunked encoding in IIS webserver in IIS webserver feature as you can see below but why is it even after I change the Enable Chuncked…
user4951
  • 32,206
  • 53
  • 172
  • 282
4
votes
1 answer

Transfer-Encoding: Chunked causes 404 The system cannot find the file specified

I am attempting to post to a page served by IIS6 and I am adding the following header: Transfer-Encoding: chunked When I do this, I get a 404 error: The system cannot find the file specified.. If I make the same request to the page without this…
Fenton
  • 241,084
  • 71
  • 387
  • 401
4
votes
2 answers

Forcing chunked encoding in Tomcat response

I am migrating an application for a customer to Tomcat 6. During testing we discovered that some of their clients expect the response to always be chunked, i.e. Transfer-encoding: chunked. However, Tomcat does not always use chunked encoding and…
Blake
  • 581
  • 4
  • 14
4
votes
2 answers

C parsing HTTP Chunked transfer encoding response

I am developing a client that needs to parse Chunked-type HTTP transfers. I've beat my head against the wall trying to figure out the error with the following, and would appreciate it if someone might be able to catch my error a bit quicker. To sum…
4
votes
2 answers

WinInet - can't remove Content-Length from headers to manually chunk an upload

MSDN states that WinInet does not support chunked upload ("Client code must perform the chunking."). To me that meant I could manually chunk the transfer. My intention was to add "Transfer-Encoding: chunked" via HttpAddRequestHeaders, remove…
ribram
  • 2,392
  • 1
  • 18
  • 20
3
votes
1 answer

Tried to parse chunked transfer encoding,it's not working though, the file which I decoded is totally unreadable

I tried to parse the data which was generated by chunked transfer encoding in a Rest API ,I did see the data has value when I tried to print the value in a string and I thought it should be working,but when I tried to assign the value to the file,…
Ken
  • 47
  • 6
3
votes
1 answer

SSE event data gets cut off when using Nginx

I am implementing a web interface using React and Flask. One component of this interface is a server sent event that is used to update data in the front end whenever it is updated in a database. This data is quite large and one event could contain…