Skip to content

Commit

Permalink
better Mojo::Transactor examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 4, 2012
1 parent 741158e commit 35e6ae8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Mojo/UserAgent/Transactor.pm
Expand Up @@ -279,9 +279,10 @@ implements the following new ones.
my $tx = $t->form('http://kraih.com' => {a => 'b'} => {DNT => 1});
my $tx = $t->form('http://kraih.com', 'UTF-8', {a => 'b'}, {DNT => 1});
Versatile L<Mojo::Transaction::HTTP> builder for form requests.
Versatile L<Mojo::Transaction::HTTP> builder for C<POST> requests with form
data.
# Inspect request
# Inspect generated request
say $t->form('mojolicio.us' => {a => [1, 2, 3]})->req->to_string;
# Submit form and stream response
Expand Down Expand Up @@ -330,6 +331,9 @@ or C<307> redirect response if possible.
Versatile general purpose L<Mojo::Transaction::HTTP> builder for requests.
# Inspect generated request
say $t->tx(GET => 'mojolicio.us' => {DNT => 1} => 'Bye!')->req->to_string;
# Streaming response
my $tx = $t->tx(GET => 'http://mojolicio.us');
$tx->res->body(sub { say $_[1] });
Expand Down

0 comments on commit 35e6ae8

Please sign in to comment.