Just another Perl shrine | |
PerlMonks |
Re: HTTP 302 error now??by IlyaM (Parson) |
on May 22, 2002 at 16:10 UTC ( [id://168497]=note: print w/replies, xml ) | Need Help?? |
Very helpful, but now I have that crazy HTTP 302 error.
The problem with HTTP error is caused by default behaviour of LWP::UserAgent. Sorry I forgot about it when I wrote my version of this script. LWP::UserAgent by default doesn't handles redirects after POST requests automatically. If you have not very old version of LWP::UserAgent you can redifine this behaviour using following sniplet:
Also, Ilya you had simple_request on the second post. Did you mean to have just 'request' there? I'm sorry. I did mean $ua->request instead of $ua->simple_request. And do I not need "my $request = " on the first "$ua->request(POST..." line? Since you do not use response object from first request there is no need to store it in any variable. I have updated script in my first node with all fixes.
--
In Section
Seekers of Perl Wisdom
|
|