Cataly...equest(3pm)
π NAME π
Catalyst::Plugin::SubRequest β make subrequests to actions in Catalyst, bestie π¦
(also known as that Cataly...equest(3pm) page from the User Contributed Perl Documentation, iykyk)
β¨ 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 );
πΈ DESCRIPTION πΈ
Okay so, you can make subrequests to actions in Catalyst. That's the whole vibe. π
It uses the catalyst dispatcher, so it works like an external url call β no cap. Methods are provided both to get the body of the response and the full response (Catalyst::Response) object. So like, pick your fighter: just the body, or the whole entire response. π
π METHODS π
subreq [path as string or hash ref], [stash as hash ref], [parameters as hash ref]
subrequest
sub_request
Takes a full path to a path you'd like to dispatch to. β¨
If the path is passed as a hash ref then it can include body, action, match and path.
An optional second argument as hashref can contain data to put into the stash of the subrequest. π«Ά
An optional third argument as hashref can contain data to pass as parameters to the subrequest.
Returns the body of the response. That's it, that's the tea. π
subreq_res [path as string or hash ref], [stash as hash ref], [parameters as hash ref]
subrequest_response
sub_request_response
Like sub_request(), but returns a full Catalyst::Response object. It's giving main character energy, but make it a whole object instead of just the body. π₯
π SEE ALSO π
Catalyst.
π AUTHORS π
- Marcus Ramberg,
"mramberg@cpan.org" - Tomas Doran (t0m)
"bobtfish@bobtfish.net"
π MAINTAINERS π
- Eden Cardim (edenc)
"eden@insoli.de"
π§ THANK YOU π§
- SRI, for writing the awesome Catalyst framework β
- MIYAGAWA, for writing the awesome Plack toolkit β
π COPYRIGHT π
Copyright (c) 2005 - 2011 the Catalyst::Plugin::SubRequest "AUTHORS" as listed above.
π¦ LICENSE π¦
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. slay, honestly π
okay that's the whole page bestie, every single flag-free fact intact, not a crumb left behind π
this was perl v5.34.0, dated 2022-06-09, and yes it really does call itself Cataly...equest(3pm) in the corner like that β iconic abbreviation behaviour, we love to see it π
π¦ where this page comes from
- debian bookworm: libcatalyst-plugin-subrequest-perl 0.21-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcatalyst-plugin-subrequest-perl 0.21-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcatalyst-plugin-subrequest-perl 0.21-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatalyst-plugin-subrequest-perl 0.21-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatalyst-plugin-subrequest-perl 0.21-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms