minor doc changes
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Request.pm
index 6e45e69..1276fc5 100644 (file)
@@ -4,8 +4,8 @@ use strict;
 use base 'Class::Accessor::Fast';
 
 __PACKAGE__->mk_accessors(
-    qw/action arguments base cookies headers match method parameters path
-      snippets uploads user/
+    qw/action address arguments base cookies headers hostname match method
+      parameters path snippets uploads/
 );
 
 *args   = \&arguments;
@@ -17,84 +17,122 @@ Catalyst::Request - Catalyst Request Class
 
 =head1 SYNOPSIS
 
-See L<Catalyst>.
+
+    $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 L<Catalyst>.
 
 =head1 DESCRIPTION
 
-The Catalyst Request.
+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.
+
+
+=head1 METHODS
 
-=head2 METHODS
+=over 4
 
-=head3 action
+=item $req->action
 
 Contains the action.
 
     print $c->request->action;
 
-=head3 arguments (args)
+=item $req->address
+
+Contains the remote address.
+
+    print $c->request->address
+
+=item $req->arguments
 
-Returns an arrayref containing the arguments.
+=item $req->args
+
+Returns a reference to an array containing the arguments.
 
     print $c->request->arguments->[0];
 
-=head3 base
+=item $req->base
 
 Contains the uri base.
 
-=head3 cookies
+=item $req->cookies
 
-Returns a hashref containing the cookies.
+Returns a reference to a hash containing the cookies.
 
     print $c->request->cookies->{mycookie}->value;
 
-=head3 headers
+=item $req->headers
 
-Returns a L<HTTP::Headers> object containing the headers.
+Returns an L<HTTP::Headers> object containing the headers.
 
     print $c->request->headers->header('X-Catalyst');
 
-=head3 match
+=item $req->hostname
+
+Contains the remote hostname.
+
+    print $c->request->hostname
+
+=item $req->match
 
 Contains the match.
 
     print $c->request->match;
 
-=head3 parameters (params)
+=item $req->parameters
+
+=item $req->params
 
-Returns a hashref containing the parameters.
+Returns a reference to a hash containing the parameters.
 
     print $c->request->parameters->{foo};
 
-=head3 path
+=item $req->path
 
 Contains the path.
 
     print $c->request->path;
 
-=head3 method
+=item $req->method
 
-Contains the request method.
+Contains the request method (C<GET>, C<POST>, C<HEAD>, etc).
 
     print $c->request->method
 
-=head3 snippets
+=item $req->snippets
 
-Returns an arrayref containing regex snippets.
+Returns a reference to an array containing regex snippets.
 
     my @snippets = @{ $c->request->snippets };
 
-=head3 uploads
-
-Returns a hashref containing the uploads.
+=item $req->uploads
 
-    print $c->request->uploads->{foo}->filename;
-    print $c->request->uploads->{foo}->type;
-    print $c->request->uploads->{foo}->size;
-    my $fh = $c->request->uploads->{foo}->fh;
+Returns a reference to a hash containing the uploads.
 
-=head3 user
+    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> };
 
-Returns the user.
+=back
 
 =head1 AUTHOR