commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ot...@ivillage.com
Subject HTTP Client API comment and Q about HttpException
Date Sun, 02 Dec 2001 00:01:00 GMT
Hello,



I hate asking this type of stuff on the -dev list, but it looks like jakarta-commons doesn't
exist any more.



This API doesn't make sense to me:

To get the value of a HTTP response header (e.g. 'text/html' part in 'Content-type: text/html'
header) I have to do this:



Header header = ....

header.getValues()[0].getName();



Wouldn't it make more sense to call getValue() instead of getName()?





Also, it looks like HTTP Client is super strict and throws HttpException when it encounters
responses such as these two:



$ GET -S -e -d www.ananzi.co.za

GET http://www.ananzi.co.za --> 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

Title: Ananzi South Africa - Search Engine





$ GET -S -e -d www.burkina98.com

GET http://www.burkina98.com --> 200 OK

Connection: close

Date: Sat, 01 Dec 2001 23:59:57 GMT

Accept-Ranges: bytes

ETag: "8d78a-335a-3c049438"

Server: Apache/1.3.19 (Unix)  (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 PHP/4.0.4pl1
mod_perl/1.24_01

Content-Length: 13146

Content-Type: text/html

Content-Type: text/html; charset=windows-1252

Last-Modified: Wed, 28 Nov 2001 07:37:28 GMT

Client-Date: Sat, 01 Dec 2001 23:49:53 GMT

Client-Response-Num: 1





The HttpException message is:

"Error in parsing the status line from the response: null"



What is it not getting that it needs?



Thanks,

Otis


_________________________________________________________________
iVillage.com: Solutions for Your Life 
Check out the most exciting women's community on the Web   
http://www.ivillage.com

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message