X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FRequest.pm;h=f0732ab37530d8b98e14f650b39af3b6c2c9fc21;hb=d631b5f988682607cb4bc42627ffb87f0da28b47;hp=117902e5218cfde35b988de67505cf83127711dc;hpb=e561386ff49b0b44ad131d72b807c076825bcdb3;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index 117902e..f0732ab 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -101,9 +101,23 @@ Returns a reference to an array containing the arguments. print $c->request->arguments->[0]; +For example, if your action was + + package MyApp::C::Foo; + + sub moose : Local { + ... + } + +And the URI for the request was C the string C +would be the first and only argument. + =item $req->base -Contains the url base. This will always have a trailing slash. +Contains the URI base. This will always have a trailing slash. + +If your application was queried with the URI C +then C is C. =cut @@ -144,6 +158,8 @@ be either a scalar or an arrayref containing scalars. print $c->request->body_parameters->{field}; print $c->request->body_parameters->{field}->[0]; + +These are the parameters from the POST part of the request, if any. =item $req->body_params @@ -204,6 +220,9 @@ Returns a reference to a hash containing the cookies. print $c->request->cookies->{mycookie}->value; +The cookies in the hash are indexed by name, and the values are C +objects. + =item $req->header Shortcut to $req->headers->header @@ -323,6 +342,8 @@ be either a scalar or an arrayref containing scalars. print $c->request->parameters->{field}; print $c->request->parameters->{field}->[0]; +This is the combination of C and C. + =cut sub parameters { @@ -375,6 +396,9 @@ be either a scalar or an arrayref containing scalars. print $c->request->query_parameters->{field}; print $c->request->query_parameters->{field}->[0]; + +These are the parameters from the query string portion of the request's URI, if +any. =item $req->read( [$maxlength] )