curl http://0:5000/ -F code=@/home/moo/post-echo.psgi POST http://example.org/ Expect: 100-continue Content-Length: 2408 Content-Type: multipart/form-data; boundary=----------------------------2db0025e93ba ------------------------------2db0025e93ba Content-Disposition: form-data; name="code"; filename="post-echo.psgi" Content-Type: application/octet-stream #!/usr/bin/env perl # filename: post-echo.psgi use strictures; use Plack::Request; use HTTP::Request; sub { my $env = shift; my $request = Plack::Request->new($env); my $response = $request->new_response(200); $response->content_type("text/plain; charset=UTF-8"); if ( $request->method eq "POST" ) { $request->input->read( my $buffer, $request->header("Content-Length"), 0 ); my $rerequest = HTTP::Request ->new( "POST", "http://example.org/" , $request->headers, $buffer ); $response->body( $rerequest->as_string ); } else { $response->body("OHAI " . $request->method . "\n"); } $response->finalize; };