You may also want to check out the WWW::Mechanize module this will do what your
looking for.
Mike
----- Original Message -----
From: "Mumia W." <[EMAIL PROTECTED]>
To: "Beginners CGI" <beginners-cgi@perl.org>
Sent: Friday, February 16, 2007 12:49 PM
Subject: Re: redirecting cgi via post method
On 02/16/2007 12:00 PM, [EMAIL PROTECTED] wrote:
Greetings,
I have a CGI that receives some parameters, and after processing them (it
generates a file) it must be redirected to another CGI (external domain) to
process it.
What I want to do is similar to
redirect("http://somedomain.com/cgi-bin/myscript.cgi?param1=some¶m2=stuff");
but using POST method instead of GET.
At first point, I imagine a solution with LWP::UserAgent using the POST
method for the new user agent; but later, I don't know how to be redirected
to the new address.
my $ua_this = LWP::UserAgent->new;
$ua_this->post("http://somedomain.com/cgi-bin/myscript.cgi", [
param1 => "some",
param2 => "stuff"
] );
redirect($ua_this); # <-this? I don't think so
Any help will be appreciated.
Alejandro
You probably want a status 307 redirect:
use strict;
use warnings;
use CGI;
# You set the $location.
print CGI::header(
-status => '307 Temporary Redirect',
-location => $location,
);
__HTH__
HTTP Spec: ftp://ftp.isi.edu/in-notes/rfc2616.txt
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/