You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by cj_tomekk <cj...@poczta.onet.pl> on 2010/01/27 12:01:35 UTC

When returning page is 404 no InputStream can be read

Hello,
I have such a problem that I recieve HTTP content from a specified address
after GET/POST methods.
Tipically:
HttpResponse hresponse = httpclient.execute(hrequest);

Getting the entity:
HttpEntity entity = hresponse.getEntity();

When return code is for example 200 it enables me to get the stream and do
sth with it.

When return code if 404 no data can be retrieved. Normally doing action by
browser gives a specific 404 page.

Please help.
-- 
View this message in context: http://old.nabble.com/When-returning-page-is-404-no-InputStream-can-be-read-tp27336341p27336341.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: When returning page is 404 no InputStream can be read

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2010-01-27 at 23:08 -0800, cj_tomekk wrote:
> Hmm whats a curl? isn't browser with traffic monitoring enough for
> comparison?

Use wire logging of HttpClient to see exactly what kind of HTTP messages
get sent across the wire. 

Oleg  


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: When returning page is 404 no InputStream can be read

Posted by cj_tomekk <cj...@poczta.onet.pl>.
Hmm whats a curl? isn't browser with traffic monitoring enough for
comparison?
-- 
View this message in context: http://old.nabble.com/When-returning-page-is-404-no-InputStream-can-be-read-tp27336341p27351898.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: When returning page is 404 no InputStream can be read

Posted by Ken Krugler <kk...@transpac.com>.
On Jan 27, 2010, at 3:01am, cj_tomekk wrote:

>
> Hello,
> I have such a problem that I recieve HTTP content from a specified  
> address
> after GET/POST methods.
> Tipically:
> HttpResponse hresponse = httpclient.execute(hrequest);
>
> Getting the entity:
> HttpEntity entity = hresponse.getEntity();
>
> When return code is for example 200 it enables me to get the stream  
> and do
> sth with it.
>
> When return code if 404 no data can be retrieved. Normally doing  
> action by
> browser gives a specific 404 page.

 From my experience w/HttpClient (4.0), sometimes I get a response  
entity w/a 404, and sometimes I don't.

The browser might be synthesizing something (depending on the browser)  
for empty 404 pages.

What happens when you do a GET request to that server via curl (with  
the -v option)?

-- Ken

--------------------------------------------
Ken Krugler
+1 530-210-6378
http://bixolabs.com
e l a s t i c   w e b   m i n i n g





---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org