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 sub_request
38 Takes a full path to a path you'd like to dispatch to.
39
40 If the path is passed as a hash ref then it can include body,
41 action, match and path.
42
43 An optional second argument as hashref can contain data to put into
44 the stash of the subrequest.
45
46 An optional third argument as hashref can contain data to pass as
47 parameters to the subrequest.
48
49 Returns the body of the response.
50
51 subreq_res [path as string or hash ref], [stash as hash ref],
52 [parameters as hash ref]
53 sub_request_response
54 Like "sub_request()", but returns a full Catalyst::Response object.
55
57 Catalyst.
58
60 Marcus Ramberg, "mramberg@cpan.org"
61
62 Tomas Doran (t0m) "bobtfish@bobtfish.net"
63
65 SRI, for writing the awesome Catalyst framework
66
68 Copyright (c) 2005 - 2008 the Catalyst::Plugin::SubRequest "AUTHORS" as
69 listed above.
70
72 This program is free software, you can redistribute it and/or modify it
73 under the same terms as Perl itself.
74
75
76
77perl v5.12.0 2010-01-28 Catalyst::Plugin::SubRequest(3)