bompa, how did you enable the redirects to follow them automatically, can you show me for the lwp and i'l figure it out for mechanize like that time with the cookies. its not as simple as $mech->redirect_ok(1)
Sure.
With LWP, POST is not normally redirectable, so it needs to be added.
To keep it in context, here's a block of the code that I was talking about hitting five redirects:
$ua = LWP::UserAgent->new(requests_redirectable => [ 'GET', 'HEAD', 'POST' ] );
$ua->credentials(
'mysite.com:2095',
'WebMail',
'myusername' => 'mypassword'
);
$ua->max_redirect( 10 );
$ua->timeout('30');
$ua->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1");
$ua->cookie_jar( {} );
----------------------------------
Normally, that $ua line would just look like this:
$ua = LWP::UserAgent->new();
Here is where I first learned it, (credit nop_90 for the link, he gave it to me).
www.perlmonks.org/?node_id=380264Bompa