warpod has asked for the wisdom of the Perl Monks concerning the following question:

Hello! I'm using LWP::UserAgent and there is a problem:
my $ua = LWP::UserAgent->new(); #... my $res = $ua->post($addr, \@post_data);
The site redirects the request and UserAgent invokes GET method. But the post data is not removed! As the result I have this in the log:
GET http://somesite.com HTTP/1.1
Content-Length: 361
Posting 361 bytes...
...

And the site returns error on such request, $res contains error. If there is no posting data, the site returns OK.
Can you please help me solve the problem?

Replies are listed 'Best First'.
Re: POST redirects to GET problem
by lorn (Monk) on Jul 25, 2006 at 13:40 UTC