NAME

Catalyst::Request - Catalyst Request Class

SYNOPSIS

$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.

DESCRIPTION

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.

METHODS

$req->action

Contains the action.

print $c->request->action;
$req->address

Contains the remote address.

print $c->request->address
$req->arguments
$req->args

Returns a reference to an array containing the arguments.

print $c->request->arguments->[0];
$req->base

Contains the uri base.

$req->cookies

Returns a reference to a hash containing the cookies.

print $c->request->cookies->{mycookie}->value;
$req->headers

Returns an HTTP::Headers object containing the headers.

print $c->request->headers->header('X-Catalyst');
$req->hostname

Contains the remote hostname.

print $c->request->hostname
$req->match

Contains the match.

print $c->request->match;
$req->parameters
$req->params

Returns a reference to a hash containing the parameters.

print $c->request->parameters->{foo};
$req->path

Contains the path.

print $c->request->path;
$req->method

Contains the request method (GET, POST, HEAD, etc).

print $c->request->method
$req->snippets

Returns a reference to an array containing regex snippets.

my @snippets = @{ $c->request->snippets };
$req->uploads

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> };

AUTHOR

Sebastian Riedel, sri@cpan.org

COPYRIGHT

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.