Subject: problem with chunked encoding in http1.1

From: "manish kumar" <[email-masked]>
Date: Thu, 05 Jul 2001 13:25:37 -0000

Hi
I am using http 1.1..My client side code is in java and server side is 
apache server.I am sending back response in xml format.My problem is now I 
am using transfer chunked encoding and having persistent connection. I don't 
know how to handle the chunked response.How we should handle different chunk 
of response like what will be the delimiter for one chunk and all this.No 
where on net I could find the real time example. Can somebody explain me how 
we do handle it.It will be really nice if somebody can send me the example 
chunk response which will have more then one chunk of response.I tried with 
my code but It always come in one chunk.I tried for larger response also but 
it never comes in more then one chunk.Is it being handled internally and we 
will always get one chunk only.
I badly need to know it.Somebody please help me with it.

TIA
-Manish
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

---

From: "Nathan J. Yoder" <[email-masked]>
Date: Thu, 5 Jul 2001 13:37:03 -0400

My problem is now I
> chunk response which will have more then one chunk of response.

Why not just connect to a server, send a request, and record the response in
a file?  This will give an example from a real web server (I would include
an example in this message, but a multi-chunk message would be too large).
Also, have you read the section of the HTTP/1.1 RFC on chunked transfer
encoding?  It's basically just a hex number (chunk length), newline,
content, another hex number (another chunk length), another newline,
content, then a 0 after the last chunk.  There are optional headers that may
be in there too, so check the RFC to get the full details and some
imlementations like to add superfluous characters (spaces) after the chunk
length and before the newline.

Also, as a response to earlier messages as to why to avoid chunked transfer
encoding--it's simple, chunked transfer encoding is needlessly complicated,
and is not even needed for persitent connections.  HTTP/1.0 supports
persistent connections with the "Connection" field set at "Keep-Alive" and
by using the "Content-Length" field to specify the file boundry.