commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rodney Waldhoff" <>
Subject Re: HTTP Client API comment and Q about HttpException
Date Tue, 04 Dec 2001 22:10:19 GMT
>it looks like HTTP Client is super strict and throws HttpException when it 
>encounters responses such as these two:

>200 OK
>Connection: close
>Date: Sat, 01 Dec 2001 23:49:39 GMT
>Server: Apache/1.3.6 (Unix) mod_oas/4.65
>Content-Type: text/html
>Client-Date: Sat, 01 Dec 2001 23:49:42 GMT
>Client-Response-Num: 1
>Client-Transfer-Encoding: chunked

>The HttpException message is:
>"Error in parsing the status line from the response: null"
>What is it not getting that it needs?

What's missing is the HTTP-Version part of the response status line.  Per 
section 6.1 of RFC 2616 (, the status 
line should start with "HTTP/1.0" or "HTTP/1.1" (or similiar).

"6.1 Status-Line

The first line of a Response message is the Status-Line, consisting
of the protocol version followed by a numeric status code and its
associated textual phrase, with each element separated by SP
characters. [...]
Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF"

I've changed the exception message to be more explict (it now reads "unable 
to find line starting with "HTTP/"" where it previously said "null"), but I 
believe the current behavior is accurate according to the spec.

What's generating that status line?  Are there common servers/services that 
violate the spec in this way?

Get your FREE download of MSN Explorer at

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message