hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h2ooo <h2oo...@gmail.com>
Subject Re: HttpStatus OK but Zero length response?
Date Tue, 18 Jan 2005 02:56:56 GMT
Hi!

The following are the logs:

 1: [DEBUG] HttpConnection - Open connection to myweb.com:80
 2: [DEBUG] header - >> "GET login.php?uid=10 HTTP/1.1[\r][\n]"
 3: [DEBUG] HttpMethodBase - Adding Host request header
 4: [DEBUG] header - >> "User-Agent: Jakarta
Commons-HttpClient/3.0-beta1[\r][\n]"
 5: [DEBUG] header - >> "Host: myweb.com[\r][\n]"
 6: [DEBUG] header - >> "[\r][\n]"
 7: [DEBUG] header - << "HTTP/1.1 200 OK[\r][\n]"
 8: [DEBUG] header - << "Date: Tue, 18 Jan 2005 02:26:28 GMT[\r][\n]"
 9: [DEBUG] header - << "Server: Apache/2.0.46 (Red Hat)[\r][\n]"
10: [DEBUG] header - << "Accept-Ranges: bytes[\r][\n]"
11: [DEBUG] header - << "X-Powered-By: PHP/4.3.2[\r][\n]"
12: [DEBUG] header - << "Content-Length: 0[\r][\n]"
13: [DEBUG] header - << "Connection: close[\r][\n]"
14: [DEBUG] header - << "Content-Type: text/html[\r][\n]"
15: [DEBUG] HttpMethodBase - Should close connection in response to
Connection: close

If I understand the logs correctly, line 12 said the response from the
server is really 0 byte, so there is nothing wrong with my program,
correctly??


On Mon, 17 Jan 2005 12:07:04 +0100, Oleg Kalnichevski <olegk@apache.org> wrote:
> On Mon, Jan 17, 2005 at 05:37:35PM +0800, h2ooo wrote:
> > When accessing a web page using GetMethod, say
> > http:\\myweb.com\login.php?uid=10, the returned HttpStatus is OK.
> >
> > However, the InputStream from getResponseBodyAsStream() returned
> > nothing (or zero byte).
> >
> > Is this OK? Or could there be something I have overlook in the library?
> >
> 
> Even though empty response does not really make sense, there's nothing
> illegal about that from the HTTP spec's standpoint. Frequently badly
> written CGI scripts return an empty response instead of a meaningful
> error message when encountering a problem processing the request. Please
> refer to the troubleshooting guide for things to try out
> 
> http://jakarta.apache.org/commons/httpclient/troubleshooting.html
> 
> and if you are unable to solve the problem, post the context/wire log of
> the HTTP session to this mailing list
> 
> Oleg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
>

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


Mime
View raw message