Catalyst::Request - Catalyst Request Class
$req = $c->request; $req->action; $req->address; $req->args; $req->arguments; $req->base; $req->cookies; $req->headers; $req->hostname; $req->match; $req->method; $req->parameters; $req->params; $req->path; $req->snippets; $req->uploads;
See also Catalyst.
This is the Catalyst Request class, which provides a set of accessors to the request data. The request object is prepared by the specialized Catalyst Engine module thus hiding the details of the particular engine implementation.
Contains the action.
print $c->request->action;
Contains the remote address.
print $c->request->address
Returns a reference to an array containing the arguments.
print $c->request->arguments->[0];
Contains the uri base.
Returns a reference to a hash containing the cookies.
print $c->request->cookies->{mycookie}->value;
Returns an HTTP::Headers object containing the headers.
print $c->request->headers->header('X-Catalyst');
Contains the remote hostname.
print $c->request->hostname
Contains the match.
print $c->request->match;
Returns a reference to a hash containing the parameters.
print $c->request->parameters->{foo};
Contains the path.
print $c->request->path;
Contains the request method (GET, POST, HEAD, etc).
GET
POST
HEAD
print $c->request->method
Returns a reference to an array containing regex snippets.
my @snippets = @{ $c->request->snippets };
Returns a reference to a hash containing the uploads.
my $filename = $c->req->parameters->{foo}; print $c->request->uploads->{$filename}->{type}; print $c->request->uploads->{$filename}->{size}; my $fh = $c->request->uploads->{$filename}->{fh}; my $content = do { local $/; <$fh> };
Sebastian Riedel, sri@cpan.org
sri@cpan.org
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst
CPAN shell
perl -MCPAN -e shell install Catalyst
For more information on module installation, please visit the detailed CPAN module installation guide.