ASP4-PSGI
view release on metacpan or search on metacpan
lib/ASP4/PSGI.pm view on Meta::CPAN
my $env = shift;
my $preq = Plack::Request->new( $env );
local %ENV = %$env;
require ASP4::API;
my $api = ASP4::API->new();
# Parse cookies:
foreach my $cookie ( split /;\s*/, ($ENV{HTTP_COOKIE}||'') )
{
my ($k,$v) = map { ASP4::SimpleCGI->unescape($_) } split /\=/, $cookie;
$api->ua->add_cookie( $k => $v );
}# end foreach()
# Execute the request:
my $method = lc( $ENV{REQUEST_METHOD} );
my $res = do {
# Is it a GET, POST or Upload?
if( $method eq 'get' )
{
# GET
( run in 0.560 second using v1.01-cache-2.11-cpan-b888b73be4d )