1 package Catalyst::Request;
4 use base 'Class::Accessor::Fast';
6 __PACKAGE__->mk_accessors(
7 qw/action arguments base cookies headers match method parameters path
8 server_base snippets uploads/
12 *params = \¶meters;
16 Catalyst::Request - Catalyst Request Class
32 print $c->request->action;
34 =head3 arguments (args)
36 Returns an arrayref containing the arguments.
38 print $c->request->arguments->[0];
42 Contains the uri base.
46 Returns a hashref containing the cookies.
48 print $c->request->cookies->{mycookie}->value;
52 Returns a L<HTTP::Headers> object containing the headers.
54 print $c->request->headers->header('X-Catalyst');
60 print $c->request->match;
62 =head3 parameters (params)
64 Returns a hashref containing the parameters.
66 print $c->request->parameters->{foo};
72 print $c->request->path;
76 Contains the request method.
78 print $c->request->method
82 Contains the server part of the uri base.
86 Returns an arrayref containing regex snippets.
88 my @snippets = @{ $c->request->snippets };
92 Returns a hashref containing the uploads.
94 my $filename = $c->req->parameters->{foo};
95 print $c->request->uploads->{$filename}->type;
96 print $c->request->uploads->{$filename}->size;
97 my $fh = $c->request->uploads->{$filename}->fh;
98 my $content = do { local $/; <$fh> };
102 Sebastian Riedel, C<sri@cpan.org>
106 This program is free software, you can redistribute it and/or modify it under
107 the same terms as Perl itself.