1Catalyst::Plugin::SubReUqsueerstC(o3n)tributed Perl DocuCmaetnatlaytsito:n:Plugin::SubRequest(3)
2
3
4
6 Catalyst::Plugin::SubRequest - Make subrequests to actions in Catalyst
7
9 use Catalyst 'SubRequest';
10
11 my $res_body = $c->subreq('/test/foo/bar', { template => 'magic.tt' });
12
13 my $res_body = $c->subreq( {
14 path => '/test/foo/bar',
15 body => $body
16 }, {
17 template => 'magic.tt'
18 });
19
20 # Get the full response object
21 my $res = $c->subreq_res('/test/foo/bar', {
22 template => 'mailz.tt'
23 }, {
24 param1 => 23
25 });
26 $c->log->warn( $res->content_type );
27
29 Make subrequests to actions in Catalyst. Uses the catalyst dispatcher,
30 so it will work like an external url call. Methods are provided both
31 to get the body of the response and the full response
32 (Catalyst::Response) object.
33
35 subreq [path as string or hash ref], [stash as hash ref], [parameters
36 as hash ref]
37 subrequest
38 sub_request
39 Takes a full path to a path you'd like to dispatch to.
40
41 If the path is passed as a hash ref then it can include body,
42 action, match and path.
43
44 An optional second argument as hashref can contain data to put into
45 the stash of the subrequest.
46
47 An optional third argument as hashref can contain data to pass as
48 parameters to the subrequest.
49
50 Returns the body of the response.
51
52 subreq_res [path as string or hash ref], [stash as hash ref],
53 [parameters as hash ref]
54 subrequest_response
55 sub_request_response
56 Like "sub_request()", but returns a full Catalyst::Response object.
57
59 Catalyst.
60
62 Marcus Ramberg, "mramberg@cpan.org"
63
64 Tomas Doran (t0m) "bobtfish@bobtfish.net"
65
67 Eden Cardim (edenc) "eden@insoli.de"
68
70 SRI, for writing the awesome Catalyst framework
71
72 MIYAGAWA, for writing the awesome Plack toolkit
73
75 Copyright (c) 2005 - 2011 the Catalyst::Plugin::SubRequest "AUTHORS" as
76 listed above.
77
79 This program is free software, you can redistribute it and/or modify it
80 under the same terms as Perl itself.
81
82
83
84perl v5.34.0 2021-07-22 Catalyst::Plugin::SubRequest(3)