use Plack::Request; my $app_or_middleware = sub { my $env = shift; # PSGI env my $req = Plack::Request->new($env); my $path_info = $req->path_info; my $query = $req->param('query'); my $content = $req->content; my $res = $req->new_response(200); # new Plack::Response $res->content_type('text/plain'); $res->body([ "Received your request, all ", $req->content_length, " bytes, thanks , here Is what I got \n", $content ]); return $res->finalize; }; require Plack::Runner; my $runner = Plack::Runner->new; $runner->parse_options( qw' --host 127.0.0.1 '); $runner->run($app_or_middleware);