if you add use Apache2::RequestIO
and from my ($r) = @_;
you can do a $r->print();
a PerlResponseHandler
can not modify request data, but even if it could what would be the point. Only a PerlInputFilterHandler
can do that as it filters input before it gets to a response.
The only thing after a response handler is the Output Filters, Log Handler, and the Cleanup Handler.
package MyFilter;
use strict;
use base qw(Apache::Filter);
use Apache2::Const qw(OK);
sub handler: FilterRequestHandler {
my ($f) = @_;
while($f->read(my $buf, 1024)) {
# do something with $buf
$f->print($buf);
}
return OK;
}
1;
Important to know, that you will get data in chunks. When you read you may or may not get the whole posted in a single call.