bwarn has asked for the wisdom of the Perl Monks concerning the following question:
Does anyone have any suggestions how to successfully follow redirects?
$ua = new LWP::UserAgent; $request = new HTTP::Request('HEAD', "$URLVAL{URL}"); ($response) = $ua->request($request); if ($response->is_success) { print "Location:$URLVAL{URL}\n\n"; # quits if destination site redir +ects using '?' [or encoded equivalent] in its redirection script } else { # send user to another cgi that displays some 'failed URL' text. }
Originally posted as a Categorized Question.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I programatically follow redirects?
by gunder (Novice) on Apr 04, 2003 at 09:37 UTC |