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
6
votes
4 answers

Chunked http decoding in java?

I am decoding http packets. And I faced a problem that chunk problem. When I get a http packet it has a header and body. When transefer-encoding is chunked I don't know what to do ? Is there a useful API or class for dechunk the data in JAVA ? And…
CodingForever
  • 85
  • 1
  • 2
  • 4
6
votes
1 answer

Tomcat gzip while chunked issue

I'm expiriencing some problem with one of my data source services. As it says in HTTP response headers it's running on Apache-Coyote/1.1. Server gives responses with Transfer-Encoding: chunked, here sample response: HTTP/1.1 200 OK Server:…
hoodoos
  • 340
  • 1
  • 4
  • 12
6
votes
0 answers

Jersey Client: Sending trailers in HTTP request with chunked transfer

I am implementing a java client to upload large files to the Akamai NetStorage Version 4 (Object Storage) via HTTP API. When using chunked transfer, the API requires trailing headers (trailers) to be send at the end of the message body. Currently I…
akyras
  • 61
  • 1
6
votes
3 answers

How do I force apache to deliver a file in chunked encoded format

I am verifying if my application handles file content delivered through chunked-encoding mode. I am not sure what change to make to the httpd.conf file to force chunked encoding through Apache. Is it even possible to do this with Apache server, if…
sgowd
  • 946
  • 3
  • 10
  • 27
6
votes
4 answers

Django return http early flush (chunked response)

I have an algorithm which waits for almost 5 seconds to generate response and I want to send an ack (http 200) to user as soon as he sends request to tell him that his request has been received and wait for 5 seconds. Generator function: def…
Zubair Afzal
  • 2,016
  • 20
  • 29
6
votes
2 answers

Losing 6 bytes but only if socket goes quiet for 60 seconds?

I've been running two socket clients side-by-side, collecting http streaming data (not Twitter, but similar kind of thing). The data comes through in chunked encoding. One of the clients is curl (on the commandline, not php-curl), where both http…
Darren Cook
  • 27,837
  • 13
  • 117
  • 217
6
votes
1 answer

How to generate Chunked response with a Trailer in Apache/PHP?

I know I can generate chunked response in PHP simply by introducing a sleep() in the output. But is it possible to also generate a Trailer HTTP section in PHP? If not, is it possible in general in Apache 2.2? I need it for testing purposes.
rustyx
  • 80,671
  • 25
  • 200
  • 267
6
votes
3 answers

If a HTTP/1.0 client requests Connection: keep-alive, will it understand chunked encoding?

If my HTTP server gets an HTTP/1.0 request with the "Connection: keep-alive" header, is it a fair bet that the client will understand "Transfer-Encoding: chunked"? Essentially, I'm trying to decide whether to honour the "Connection: keep-alive"…
5
votes
1 answer

HTTP Content-Length and Chunked Transfer-Encoding. Is there a 2GB Limit?

Is a HTTP Content-Length over 2GB or 4GB supported by modern webservers? How about the chunks in HTTP Chunked Transfer Encoding? Can an individual HTTP chunk exceed 2GB in length? I need to know to use 32-bit integers or 64-bit integers in my code.
unixman83
  • 9,421
  • 10
  • 68
  • 102
5
votes
2 answers

How to make a chunked request via nginx

It seems that nginx does not support chunked requests well. But I'm trying to get a more definitive (and current) answer. I have a client making a SOAP request to a server from a Java client which sets the header Transfer-Encoding: chunked. All…
mdahlman
  • 9,204
  • 4
  • 44
  • 72
5
votes
2 answers

IIS7 refuses chunked-encoded file upload

I have a Windows/Apache2/PHP app that receives file using chunked encoding. The reason is that the file uploaded is dynamic and its length is not known before transfer. This has always worked fine out of the box. Now I need to port the app to…
Serge Wautier
  • 21,494
  • 13
  • 69
  • 110
5
votes
2 answers

Reading Body on chunked transfer encoded http requests in ASP.NET

A J2ME client is sending HTTP POST requests with chunked transfer encoding. When ASP.NET (in both IIS6 and WebDev.exe.server) tries to read the request it sets the Content-Length to 0. I guess this is ok because the Content-length is unknown when…
CVertex
  • 17,997
  • 28
  • 94
  • 124
5
votes
0 answers

How to return chunked binary data in flask response?

I have a flask endpoint handling get requests and I am interested in returning a list of objects (serialised) in a response, but in "chunked" way. By that, I mean that when I make a get request to that endpoint, I want to be able to iterate over the…
Vini
  • 223
  • 1
  • 3
  • 9
5
votes
2 answers

chunked encoding and connection:close together

I'm a bit confused about what to do with the "Connection" header when using chunked-encoding. Shall the "Connection" header not be added (or set to keep-alive, which is the same as we're talking about HTTP 1.1) or is this authorized to set it to…
philippe_44
  • 337
  • 3
  • 11
5
votes
0 answers

Angular 4.3 HttpClient Chunked Uploads

I have to deal with huge file uploads (over 4GB). Currently I am using the new HttpClient. Is it possible to set a option for chunked uploads in the new HttpClient Module in Angular 4.3? I found a solution for Angularjs with the ng-file-upload…
smedasn
  • 1,249
  • 1
  • 13
  • 16