Container-Builder
view release on metacpan or search on metacpan
examples/fatpacked.plackup view on Meta::CPAN
hash to get headers, cookies and query parameters much like
L<Apache::Request> in mod_perl.
L<Plack::Response> does the same to construct the response array
reference.
=head2 Plack::Test
L<Plack::Test> is a unified interface to test your PSGI application
using standard L<HTTP::Request> and L<HTTP::Response> pair with simple
callbacks.
=head2 Plack::Test::Suite
L<Plack::Test::Suite> is a test suite to test a new PSGI server backend.
=head1 CONTRIBUTING
=head2 Patches and Bug Fixes
Small patches and bug fixes can be either submitted via nopaste on IRC
examples/fatpacked.plackup view on Meta::CPAN
=over 4
=item psgix.cleanup
push @{ $env->{'psgix.cleanup.handlers'} }, sub { warn "Did this later" }
if $env->{'psgix.cleanup'};
Supports the C<psgix.cleanup> extension,
in order to use it, just push a callback onto
C<< $env->{'psgix.cleanup.handlers' >>.
These callbacks are run after the C<pm_post_dispatch> hook.
=item psgix.harakiri
$env->{'psgix.harakiri.commit'} = 1
if $env->{'psgix.harakiri'};
If there is a L</manager>, then C<psgix.harakiri> will be enabled
and setting C<< $env->{'psgix.harakiri.commit'} >> to a true value
will cause C<< $manager->pm_exit >> to be called after the
request is finished.
examples/fatpacked.plackup view on Meta::CPAN
# Or, use exceptions
my $app = sub {
# ...
Plack::Recursive::ForwardRequest->throw("/new_path");
};
=head1 DESCRIPTION
Plack::Middleware::Recursive allows PSGI applications to recursively
include or forward requests to other paths. Applications can make use
of callbacks stored in C<< $env->{'plack.recursive.include'} >> to
I<include> another path to get the response (whether it's an array ref
or a code ref depending on your application), or throw an exception
Plack::Recursive::ForwardRequest anywhere in the code to I<forward>
the current request (i.e. abort the current and redo the request).
=head1 EXCEPTIONS
This middleware passes through unknown exceptions to the outside
middleware stack, so if you use this middleware with other exception
handlers such as L<Plack::Middleware::StackTrace> or
examples/fatpacked.plackup view on Meta::CPAN
$res = $test->request($request);
takes an HTTP::Request object, runs it through the PSGI application to
test and returns an HTTP::Response object.
=back
=head1 FUNCTIONS
Plack::Test also provides a functional interface that takes two
callbacks, each of which represents PSGI application and HTTP client
code that tests the application.
=over 4
=item test_psgi
test_psgi $app, $client;
test_psgi app => $app, client => $client;
Runs the client test code C<$client> against a PSGI application
( run in 2.002 seconds using v1.01-cache-2.11-cpan-140bd7fdf52 )