in reply to HTTP 302 error now??
in thread LWP, extract_cookies, etc.
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/)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
No more 302 error, just no cookie info with POST?
by inblosam (Monk) on May 22, 2002 at 20:16 UTC | |
by IlyaM (Parson) on May 22, 2002 at 21:07 UTC | |
by inblosam (Monk) on May 23, 2002 at 04:47 UTC | |
by inblosam (Monk) on May 23, 2002 at 06:15 UTC | |
by IlyaM (Parson) on May 23, 2002 at 19:50 UTC | |
|