How to read the content of "Transfer-Encoding: chunked" header
Can anybody tell me how to get or read the value of transfer encoding.
I got the HTTP Response header as "Transfer-Encoding: chunked".But i can't get the chunk size or the chunked data.
Without getting those details i cant read the content of the site.If Content-Length is in the HTTP header,i can read upto that length.But in this Transfer-Encoding case,i cant know any other details except the value "chunked".So suggest me to read the content of the site using Transfer-Encoding.
Message was edited by:
VeeraLakshmi
# 2
I used HTTPURLConnection also.If i use that am getting the values in request headers only and not in Response headers.So i cant read the content.
Then i went through RFC 2616.There i can only understand about chunked transfer encoding.Still i cant get any idea to know the chunk-size and the chunked data of the transfer encoding.Because i am getting the HTTP Header Response as "Transfer-Encoding: chunked".Below that am not getting the size and data.If i know the size or data,i can proceed by converting the hex into bytes and i can read.
# 4
Ok...but without reading from input stream how can i know the body of the message.
If the site has Content-Length header,i read from input stream upto that length and concatenate the header and body in a whole message.
But in this case,what should i do...Plz give me some suggestions.