Re: Header and Content parsing and saving as html page

2011-02-14 Thread CodingForever
Hi, oleg I used the code that you have post. But I have some problems; 1- My message can consist of multiple parts so when data transferred as chunked.(incompleted chunks) It throws; - org.apache.http.TruncatedChunkException: Truncated

Re: Header and Content parsing and saving as html page

2011-02-14 Thread CodingForever
I am still need some help Anybody can help me about this problem ? CodingForever wrote: Hi, oleg I used the code that you have post. But I have some problems; 1- My message can consist of multiple parts so when data transferred as chunked.(incompleted chunks) It throws;

Re: Header and Content parsing and saving as html page

2011-02-11 Thread CodingForever
Thanks olegk for the answer,Now I am looking that. But I will ask something I wrote the code that below. How can I get the decoded content using header parameters ? also I want to read until end of chunk specifier 0\r\n but it returns all data include test string.

Re: Header and Content parsing and saving as html page

2011-02-11 Thread Oleg Kalnichevski
On Fri, 2011-02-11 at 00:39 -0800, CodingForever wrote: Thanks olegk for the answer,Now I am looking that. But I will ask something I wrote the code that below. How can I get the decoded content using header parameters ? String s = HTTP/1.1 200 OK\r\n + Server: whatever\r\n + Date:

Re: Header and Content parsing and saving as html page

2011-02-11 Thread CodingForever
I appreciated. That is working like I want. You see that, i am trying to decoding html page using header and content(offline). And I am not a perfect about httpclient. So I could not find the best solution for my problem. Think that you have a, Header and Content(raw content(gzip,deflate,may be

Re: Header and Content parsing and saving as html page

2011-02-11 Thread Ken Krugler
Normally you'd let HttpClient handle decoding, chunked responses, etc. Then what you save is the raw content (as an array of bytes) and the response headers. Converting the above into a parsable page is something best handled by Tika (as an example), since it will attempt to determine the

Re: Header and Content parsing and saving as html page

2011-02-11 Thread CodingForever
Thanks, I will use Tika after the httpclient operations. Ken Krugler wrote: Normally you'd let HttpClient handle decoding, chunked responses, etc. Then what you save is the raw content (as an array of bytes) and the response headers. Converting the above into a parsable page is

Re: Header and Content parsing and saving as html page

2011-02-11 Thread CodingForever
Thanks olegk you gave me indeed best answer that I wait. I really appreciate your help. olegk wrote: On Fri, 2011-02-11 at 01:30 -0800, CodingForever wrote: I appreciated. That is working like I want. You see that, i am trying to decoding html page using header and content(offline). And

Header and Content parsing and saving as html page

2011-02-10 Thread Night Mare
Hi there, I have captured some http packets using wireshark. And I want to save content of these packets like index.html I can read packets and convert them to the string but i can not decode them (chunk, gzip vs. problems) For example i have a sample string like below(Note: string contains \r\n

Re: Header and Content parsing and saving as html page

2011-02-10 Thread sebb
On 10 February 2011 23:51, Night Mare nighttmm...@gmail.com wrote: Hi there, I have captured some http packets using wireshark. And I want to save content of these packets like index.html I can read packets and convert them to the string but  i can not decode them (chunk, gzip vs. problems)

Re: Header and Content parsing and saving as html page

2011-02-10 Thread Night Mare
Thanks for answer but, I looked the examples that you send many times before. But I am working on offline mode. But example codes are for online test. I will not read requests or responses from socket. I will read from a string. I need a mechanism that I will give string( header and body) and I

Re: Header and Content parsing and saving as html page

2011-02-10 Thread CodingForever
I am still need help , I could not find the solution. CodingForever wrote: Thanks for answer but, I looked the examples that you send many times before. But I am working on offline mode. But example codes are for online test. I will not read requests or responses from socket. I will read