friedo has asked for the wisdom of the Perl Monks concerning the following question:
I am having some trouble with Apache::Request in a mod_perl app. According to the (somewhat sparse) documentation, Apache::Request's param method is supposed to behave just like CGI's, and return both GET (query string) and POST parameters. For GET it works fine, but for POST, it returns nothing at all. I know that the POST data is getting to the program properly, because if I instantiate a CGI object and use that, it works fine, per this simple test:
use strict; use warnings; ... sub test_p { my ( $self, $r ) = @_; # $r is an Apache::Request instantiated earlier my $q = CGI->new; $r->print('<p>Testing Apache::Request param method<p>'); $r->print('<pre>', Dumper( { map { $_ => $r->param($_) } $r->param } ), '</pre>' ); $r->print('<p>Testing CGI param method<p>'); $r->print('<pre>', Dumper( { map { $_ => $q->param($_) }$q->param } ), '</pre>'); return OK; }
Testing Apache::Request param method
$VAR1 = {};
Testing CGI param method
$VAR1 = {
'Update.x' => '50',
'Update.y' => '10',
# and a bunch of other POST data
};
Any ideas?
Thanks,
Mike
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Apache::Request::param working for GET but not POST
by ikegami (Patriarch) on Feb 04, 2005 at 22:22 UTC | |
by friedo (Prior) on Feb 07, 2005 at 06:17 UTC |