develooper Front page | perl.libwww | Postings from June 2003

RE: 301 errors

From:
Tillman, James
Date:
June 2, 2003 09:04
Subject:
RE: 301 errors
Message ID:
2265699E79C5D51197940002B31B4EDB06C009B9@exchange.fdle.gov
> -----Original Message-----
> From: John J Lee [mailto:jjl@pobox.com]
> Sent: Tuesday, May 27, 2003 6:27 AM
> To: libwww@perl.org
> Subject: Re: 301 errors
> 
> 
> On Mon, 26 May 2003, Daniel Harrison wrote:
> [...]
> > script). Sniffing the connections shows that the server is 
> sending back:
> >
> > HTTP/1.1 301 Error..
> >
> > But $response->code is being set to 200. Is there something 
> that I am
> > missing in the way that it should detect the 301's?
> 
> Seems safe to say that a 301 response should result in a 301
> $response->code.  Have you checked LWP isn't choking on the 
> extra dots at
> the end there?
> 

Technically, 301 isn't an error, it's a "response code".  301 means
"Permanently moved", and a new URL is supposed to be supplied.  Perhaps you
have your UserAgent configured to automatically follow redirects and it's
getting a 200 response code after the redirect is followed?  There's a way
of turning this off, indicated in the LWP::UserAgent docs, if I recall.

jpt



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About