Catalyst::Plugin::SubRequest is a Perl module to make subrequests to actions in Catalyst. Uses the catalyst dispatcher, so it will work like an external url call. Methods are provided both to get the body of the response and the full response (Catalyst::Response) object.
SYNOPSIS
use Catalyst 'SubRequest';
my $res_body = $c->subreq('/test/foo/bar', { template => 'magic.tt' });
my $res_body = $c->subreq( {
path => '/test/foo/bar',
body => $body
}, {
template => 'magic.tt'
});
# Get the full response object
my $res = $c->subreq_res('/test/foo/bar', {
template => 'mailz.tt'
}, {
param1 => 23
});
$c->log->warn( $res->content_type );
Product's homepage
Requirements:
· Perl