Skip to content

Commit

Permalink
use less documentation boilerplate for every_* methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 8, 2014
1 parent 6f31800 commit 687a49f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
6 changes: 2 additions & 4 deletions lib/Mojo/Message.pm
Expand Up @@ -506,8 +506,7 @@ error.
my $cookies = $msg->every_cookie('foo');
Similar to L</"cookie">, but returns all message cookies sharing the same name
as an array reference. Note that this method caches all data, so it should not
be called before all headers have been received.
as an array reference.
# Get first cookie value
say $msg->every_cookie('foo')->[0]->value;
Expand All @@ -517,8 +516,7 @@ be called before all headers have been received.
my $uploads = $msg->every_upload('foo');
Similar to L</"upload">, but returns all file uploads sharing the same name as
an array reference. Note that this method caches all data, so it should not be
called before the entire message body has been received.
an array reference.
# Get content of first uploaded file
say $msg->every_upload('foo')->[0]->asset->slurp;
Expand Down
5 changes: 1 addition & 4 deletions lib/Mojo/Message/Request.pm
Expand Up @@ -358,10 +358,7 @@ Access request cookies, usually L<Mojo::Cookie::Request> objects.
my $values = $req->every_param('foo');
Similar to L</"param">, but returns all values sharing the same name as an
array reference. Note that this method caches all data, so it should not be
called before the entire request body has been received. Parts of the request
body need to be loaded into memory to parse C<POST> parameters, so you have to
make sure it is not excessively large, there's a 10MB limit by default.
array reference.
# Get first value
say $req->every_param('foo')->[0];
Expand Down
4 changes: 1 addition & 3 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -517,9 +517,7 @@ same name as an array reference.
my $values = $c->every_param('foo');
Similar to L</"param">, but returns all values sharing the same name as an
array reference. Parts of the request body need to be loaded into memory to
parse C<POST> parameters, so you have to make sure it is not excessively
large, there's a 10MB limit by default.
array reference.
# Get first value
my $first = $c->every_param('foo')->[0];
Expand Down

0 comments on commit 687a49f

Please sign in to comment.