on 6/12/03 3:32 PM, [EMAIL PROTECTED] purportedly said:

> I have one question about the redirection. The following is my code:
> 
> use LWP::UserAgent;
> my $ua=LWP::UserAgent->new;
> my $req=HTTP::Request->new
> (GET=>'http://www.somedomainhere.com/redirect/mdm2.htm');   # this URL should
> be
> directed to another one
> 
> my $res=$ua->request($req);
> my $string = $res->content;
> 
> But when I run the program, it didn't automatically redirect to another web
> URL. It just show me "The web page has been removed.... blah blah". According
> to
> LWP document, the request "GET" should be in the redirect list. Why it doesn't
> work? Could someone help me for this? Thanks!

LWP will only redirect on an HTTP redirect (e.g. status 302). Web sites may
use other methods to simulate a redirect, such as JavaScript or META
refresh, which LWP doesn't parse and handle.

It would be more helpful if you provided the full response with headers.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"

Reply via email to