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:
push @{ $ua->requests_redirectable }, 'POST';
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.
--
Ilya Martynov
(http://martynov.org/)
In reply to Re: HTTP 302 error now??
by IlyaM
in thread LWP, extract_cookies, etc.
by inblosam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |