package Cookbook::ReadPOST;
use Apache::Constants qw(OK);
use strict;
sub handler {
my $r = shift;
my $content;
$r->read($content, $r->header_in('Content-length'));
$r->send_http_header('text/html');
$r->print("
\n");
$r->print("
Reading data
\n");
my (@pairs) = split(/[&;]/, $content);
foreach my $pair (@pairs) {
my ($parameter, $value) = split('=', $pair, 2);
$r->print("$parameter has value $value \n");
}
$r->print("\n");
return OK;
}
1;