Skip to content

Commit

Permalink
a few more parameter examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 3, 2014
1 parent c807181 commit 355ea88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Mojo/IOLoop/Client.pm
Expand Up @@ -91,7 +91,7 @@ sub _try {
return $! == EINPROGRESS ? undef : $self->emit(error => $!)
if $handle->isa('IO::Socket::IP') && !$handle->connect;
return $self->emit(error => $! = $handle->sockopt(SO_ERROR))
if !$handle->connected;
unless $handle->connected;

# Disable Nagle's algorithm
setsockopt $handle, IPPROTO_TCP, TCP_NODELAY, 1;
Expand Down
4 changes: 4 additions & 0 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -645,6 +645,9 @@ For more control you can also access request information directly.
# Only GET parameters
my $foo = $c->req->url->query->param('foo');
# Only POST parameters
my $foo = $c->req->body_params->param('foo');
# Only GET and POST parameters
my $foo = $c->req->param('foo');
Expand Down Expand Up @@ -781,6 +784,7 @@ Get L<Mojo::Message::Request> object from L<Mojo::Transaction/"req">.
my $agent = $c->req->headers->user_agent;
my $bytes = $c->req->body;
my $str = $c->req->text;
my $hash = $c->req->params->to_hash;
my $hash = $c->req->json;
my $foo = $c->req->json('/23/foo');
my $dom = $c->req->dom;
Expand Down

0 comments on commit 355ea88

Please sign in to comment.