2006-08-20
[mod_perl] Looping through request headers
After a lot of experimenting, I found the following code snippet to work best:
Resources:
my $headers = $r->headers_in();
$r->content_type( 'text/plain' );
print "Debug Dump\n\n";
$headers->do("my_filter");
return "Apache2\:\:Const\:\:OK";
sub my_filter {
my ($key, $value) = @_;
print "$key => $value\n";
return 1;
}
Resources:
- APR::Table Documentation
- Apache2::RequestRec Documentation