You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Mike Moran <mi...@mac.com> on 2003/06/02 12:57:06 UTC
300 Multiple Choices handling?
I was just skimming through the updated site and I noticed:
http://jakarta.apache.org/commons/httpclient/redirects.html
It explictly mentions 301/2/3/7 but makes no mention of 300 (Multiple
Choices). I wouldn't expect any client library to handle these
programmatically since the format of the body is undefined, but I'm
slightly concerned about the example code which would recommend treating
a 300 as if it was a 404 or some other sort of error.
I don't have the latest code up and running here to test what it would
do. A reasonable example of a 300 is:
http://www.blooberry.com//indexdotpreview/html/index8.htm. I'd be
thankful if someone could test what HttpClient does on such a page.
--
Mike Moran
Re: 300 Multiple Choices handling?
Posted by Mike Moran <mi...@mac.com>.
Ortwin Glück wrote:
> Has anybody ever seen a 300 in the wild?
Yes. I gave an example in the email I sent. This page is linked to on
that site.
However, I would say that they aren't numerous.
--
Mike Moran
Re: 300 Multiple Choices handling?
Posted by Adrian Sutton <ad...@intencha.com>.
Only when I went searching for them. :)
http://www.who.int/world-health-day/index.en.shtml
and for all the examples Google knows about:
http://www.google.com/search?q=HTTP+300+%22Multiple+Choices%22&ie=UTF-
8&oe=UTF-8
I quite like the www.who.int idea of doing a search for the document
and returning the results.
Adrian.
On Monday, June 2, 2003, at 09:54 PM, Ortwin Glück wrote:
> Has anybody ever seen a 300 in the wild?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-httpclient-dev-help@jakarta.apache.org
>
Re: 300 Multiple Choices handling?
Posted by Ortwin Glück <or...@nose.ch>.
Has anybody ever seen a 300 in the wild?
Re: 300 Multiple Choices handling?
Posted by Adrian Sutton <ad...@intencha.com>.
>
> I wonder... is HttpClient perhaps parsing out "www.blooberry.com/" as
> the value for the Host: header? My URL is slightly bogus, though
> perhaps technically valid. What happens with:
> http://www.blooberry.com/indexdotpreview/html/index8.htm
> (Note no double slash)
>
> www.eskimo.com and www.blooberry.com appear to be on the same subnet;
> www.eskimo.com is perhaps the default VirtualHost.
ahhh, heh.... ya see, I *may* have just copied the URL wrong... :)
There was a full stop at the end of the URL as I copied it - once
that's removed I do indeed get a 300 response and HttpClient returns
the 300 status along with the body just like wget. Serves me right for
trusting the Mail.app to automatically copy the URL for me.
> Just wondering ...
Looks like this X-File can be closed with a really boring ending.
> --
> Mike Moran
Adrian Sutton.
Re: 300 Multiple Choices handling?
Posted by Mike Moran <mi...@mac.com>.
Adrian Sutton wrote:
>
> On Monday, June 2, 2003, at 09:57 PM, Mike Moran wrote:
>
>> Adrian Sutton wrote:
[ ... ]
>> 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 wonder... is HttpClient perhaps parsing out "www.blooberry.com/" as
the value for the Host: header? My URL is slightly bogus, though perhaps
technically valid. What happens with:
http://www.blooberry.com/indexdotpreview/html/index8.htm
(Note no double slash)
www.eskimo.com and www.blooberry.com appear to be on the same subnet;
www.eskimo.com is perhaps the default VirtualHost.
Just wondering ...
--
Mike Moran
Re: 300 Multiple Choices handling?
Posted by Mike Moran <mi...@mac.com>.
Michael Becke wrote:
> My guess is that it responds 300 for HTTP 1.0 and 302 for HTTP 1.1.
> Just a guess.
[ ... ]
It would seem not, as wget uses 1.1
--
Mike Moran
Re: 300 Multiple Choices handling?
Posted by Michael Becke <be...@u.washington.edu>.
My guess is that it responds 300 for HTTP 1.0 and 302 for HTTP 1.1.
Just a guess.
Mike
On Monday, June 2, 2003, at 08:11 AM, Adrian Sutton wrote:
>
> 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.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-httpclient-dev-help@jakarta.apache.org
>
Re: 300 Multiple Choices handling?
Posted by Adrian Sutton <ad...@intencha.com>.
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.
Re: 300 Multiple Choices handling?
Posted by Mike Moran <mi...@mac.com>.
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?
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.
> 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.
--
Mike Moran
Re: 300 Multiple Choices handling?
Posted by Adrian Sutton <ad...@intencha.com>.
Hi Mike,
HttpClient returns 300 as the status code as would be expected in such
a case. 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.
I'll create a patch for the docs to mention 300 responses. Anything
particularly important about them that I should note?
Regards,
Adrian Sutton.
On Monday, June 2, 2003, at 08:57 PM, Mike Moran wrote:
> I was just skimming through the updated site and I noticed:
>
> http://jakarta.apache.org/commons/httpclient/redirects.html
>
> It explictly mentions 301/2/3/7 but makes no mention of 300 (Multiple
> Choices). I wouldn't expect any client library to handle these
> programmatically since the format of the body is undefined, but I'm
> slightly concerned about the example code which would recommend
> treating a 300 as if it was a 404 or some other sort of error.
>
> I don't have the latest code up and running here to test what it would
> do. A reasonable example of a 300 is:
> http://www.blooberry.com//indexdotpreview/html/index8.htm. I'd be
> thankful if someone could test what HttpClient does on such a page.
>
> --
> Mike Moran
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-httpclient-dev-help@jakarta.apache.org
>