in reply to Re: LWP::UserAgent, redirection does not work
in thread LWP::UserAgent, redirection does not work

Also, it does not follow 30x-style redirects unless you tell it to

It's true that it won't parse the HTML response to look for and interpret META elements, but it does handle 3xx reponses automatically (for GET and HEAD queries by default).

use LWP::UserAgent qw( ); my $response = LWP::UserAgent->new()->get('http://www.w3.org/html'); for (;;) { my $uri = $response->request()->uri(); my $status = $response->status_line(); print("$uri => $status\n"); $response = $response->previous(); last if !defined($response); print("as a result of\n"); }
http://www.w3.org/html/ => 200 OK as a result of http://www.w3.org/html => 301 Moved Permanently