hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Sutton <adr...@intencha.com>
Subject Re: 300 Multiple Choices handling?
Date Mon, 02 Jun 2003 12:11:18 GMT

On Monday, June 2, 2003, at 09:57  PM, Mike Moran wrote:

> Adrian Sutton wrote:
>> Hi Mike,
>> HttpClient returns 300 as the status code as would be expected in 
>> such a case.
>
> Sounds reasonable. Does it also make the body available in this case?

Yes, the retrieved document is always available and (as everyone should 
know by now :) furthermore *must* always be read to avoid problems.  To 
make life easier when you call releaseConnection on a method any 
remaining response body is read before the connection is put back into 
the pool.

> The developer is then free to select whichever option they want.
>> The URL you gave however return 302 not 300 and HttpClient throws an 
>> exception because cross-site redirects are not supported.
>
> Umm. I think HttpClient and wget must disagree:
>
> $ wget --server-response 
> http://www.blooberry.com//indexdotpreview/html/index8.htm
> --12:48:55--  http://www.blooberry.com//indexdotpreview/html/index8.htm
>            => `index8.htm'
> Resolving www.blooberry.com... done.
> Connecting to www.blooberry.com[204.122.16.82]:80... connected.
> HTTP request sent, awaiting response...
>  1 HTTP/1.1 300 Multiple Choices
>
> ...
>
> A telnet to port 80 for that page also gives 300 Multiple Choices.

Interesting....  I do get a 300 from telnet, but a 302 from HttpClient:
302
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>302 Found</TITLE>
</HEAD><BODY>
<H1>Found</H1>
The document has moved <A 
HREF="http://www.eskimo.com/notfound.html">here</A>.<P>
</BODY></HTML>

I'll have to play around with some logging information to find out 
exactly what's happening, but I have used a hand crafted response to 
show that HttpClient will return the 300 status code.

>> I'll create a patch for the docs to mention 300 responses.  Anything 
>> particularly important about them that I should note?
>
> I'm not sure what the docs should say other than pointing out that 
> you'll need to parse or display the body in some non-HTTP way to get 
> any sense out of it.

There's actually a few status codes in the 3xx range that need a 
special mention so I'm adding them all in now.  The concept of a 304 
Not Modified is wierd, it's effectively a redirect to cache but that's 
not the way I'd ever thought of it.

> Mike Moran

Regards,

Adrian Sutton.


Mime
View raw message