Programming :  Student Freelance Forum For Work Experience Builders' (CertificationPoint) The fastest message board... ever.
 
PERL-Redirecting POST Requests
Posted by: adcertpoint (Moderator)
Date: April 29, 2020 04:36PM

Under mod_cgi it's not easy to redirect POST requests to some other location. With mod_perl you can easily redirect POST requests. All you have to do is read in the content, set the method to GET, populate args() with the content to be forwarded and finally do the redirect:
use Apache::Constants qw(M_GET);
my $r = shift;
my $content = $r->content;
$r->method("GET"winking smiley;
$r->method_number(M_GET);
$r->headers_in->unset("Content-length"winking smiley;
$r->args($content);
$r->internal_redirect_handler("/new/url"winking smiley;

Of course that last line can be any other kind of redirect.

Options: ReplyQuote


Sorry, only registered users may post in this forum.
This forum powered by Phorum.