Questions tagged [http-chunked]

74 questions
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
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
21
votes
0 answers

HttpURLConnection buffering rather than streaming, despite setting chunked streaming mode?

I am using HttpURLConnection to write files, some of which are quite large, to a server. final HttpURLConnection conn = (HttpURLConnection) url.openConnection(); A while back I had issues writing objects 1 GB or more. I fixed that by setting it to…
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
14
votes
2 answers

HTTP 1.1 - Can a client request that transfers not be "chunked"?

Is it possible for a HTTP 1.1 client to set a header value that indicates the responses to requests should not be chunked? Or is the only way to prevent this, is to send a HTTP 1.0 request? I've tried googling around, but all I can find is ways to…
Matt
  • 774
  • 1
  • 10
  • 28
14
votes
2 answers

Response sent in chunked transfer encoding and indicating errors happening after some data has already been sent

I am sending large amount of data in my response to the client in chunked transfer encoding format. How should I be dealing with any errors that occur midway during writing of the response? I would like to know if there is any HTTP Spec…
Kiran
  • 56,921
  • 15
  • 176
  • 161
12
votes
1 answer

How To Stream Chunked Response With Spring Boot @RestController

I have spent like a day on this and I am unable to find a solution that works. In our application we have a couple of endpoints that can return large responses. I have been trying to find a mechanism that allows us to stream the response as we…
sceaj
  • 1,573
  • 3
  • 12
  • 24
9
votes
1 answer

Have any Android developers had success receiving chunked transfer protocol from a web service?

I have struggled with several class implementations to retrieve chunked data without success. Following is a simplified code module that has the problem. After surfing around the web, it appears there have been problems in the past (2009, 2010;…
mobibob
  • 8,670
  • 20
  • 82
  • 131
9
votes
1 answer

Can HTTP multipart and chunking coexist?

I'm using apache HttpClient to post several files to server. Here's the code: public static HttpResponse stringResponsePost(String urlString, String content, byte[] image, HttpContext localContext, HttpClient httpclient) throws Exception…
Mehdi
  • 1,075
  • 1
  • 11
  • 24
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

Sending chunked HTTP 1.1 requests in Objective-C

I have the following issue: I am creating a very big SOAP request (the data is a video encoded as Base64 string) and because of that I cannot send it as a raw SOAP request but rather need to send it in HTTP 1.1 chunks. I cannot seem to figure out…
PeterD
  • 642
  • 1
  • 6
  • 17
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
3 answers

Reading file chunk by chunk

I want to read a file piece by piece. The file is split up into several pieces which are stored on different types of media. What I currently do is call each seperate piece of the file and then merge it back to the original file. The issue is that I…
david
  • 244
  • 2
  • 4
  • 11
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
1
2 3 4 5