This is the Catalyst Request class, which provides an interface to data for the current client request. The request object is prepared by Catalyst::Engine, thus hiding the details of the particular engine implementation.

Contains the URI base. This will always have a trailing slash. Note that the URI scheme (e.g., http vs. https) must be determined through heuristics; depending on your server configuration, it may be incorrect. See $req->secure for more info.

Returns the message body of the request, as returned by HTTP::Body: a string, unless Content-Type is application/x-www-form-urlencoded, text/xml, or multipart/form-data, in which case a File::Temp object is returned.

Like CGI, and unlike earlier versions of Catalyst, passing multiple arguments to this method, like this:

$c->request->param( 'foo', 'bar', 'gorch', 'quxx' );

will set the parameter foo to the multiple values bar, gorch and quxx. Previously this would have added bar as another value to foo (creating it if it didn't exist before), and quxx as another value for gorch.

NOTE this is considered a legacy interface and care should be taken when using it. scalar $c->req->param( 'foo' ) will return only the first foo param even if multiple are present; $c->req->param( 'foo' ) will return a list of as many are present, which can have unexpected consequences when writing code of the form:

$foo->bar(
a => 'b',
baz => $c->req->param( 'baz' ),
);

If multiple baz parameters are provided this code might corrupt data or cause a hash initialization error. For a more straightforward interface see $c->req->parameters.

Reads a chunk of data from the request body. This method is intended to be used in a while loop, reading $maxlength bytes on every call. $maxlength defaults to the size of the request if not specified.

Returns true or false, indicating whether the connection is secure (https). Note that the URI scheme (e.g., http vs. https) must be determined through heuristics, and therefore the reliability of $req->secure will depend on your server configuration. If you are setting the HTTPS environment variable, $req->secure should be valid.

Returns a hashref of parameters stemming from the current request's params, plus the ones supplied. Keys for which no current param exists will be added, keys with undefined values will be removed and keys with existing params will be replaced. Note that you can supply a true value as the final argument to change behavior with regards to existing parameters, appending values rather than replacing them.

Returns a rewritten URI object for the current request. Key/value pairs passed in will override existing parameters. You can remove an existing parameter by passing in an undef value. Unmodified pairs will be preserved.

You may also pass an optional second parameter that puts uri_with into append mode: