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

Redirection problem

Thread Next
From:
qmi
Date:
June 12, 2003 14:44
Subject:
Redirection problem
Message ID:
86256D43.007679F4.00@utm-notesob1.mdacc.tmc.edu


Hi, All
     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!


    Qing



Thread Next


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