Skip to content

Commit

Permalink
more content generator examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 16, 2013
1 parent 147bc47 commit e942765
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/Mojo/UserAgent/Transactor.pm
Expand Up @@ -365,12 +365,20 @@ requests, with support for content generators.
# GET request with query parameters
my $tx = $t->tx(GET => 'http://example.com' => form => {a => 'b'});
# PUT request with UTF-8 encoded "application/x-www-form-urlencoded" content
# POST request with "application/json" content
my $tx = $t->tx(
POST => 'http://example.com' => json => {a => 'b', c => [1, 2, 3]});
# POST request with "application/x-www-form-urlencoded" content
my $tx = $t->tx(
POST => 'http://example.com' => form => {a => 'b', c => 'd'});
# PUT request with UTF-8 encoded form values
my $tx = $t->tx(
PUT => 'http://example.com' => form => {a => 'b'} => charset => 'UTF-8');
# PUT request with form values sharing the same name
my $tx = $t->tx(PUT => 'http://example.com' => form => {a => [qw(b c d)]});
# POST request with form values sharing the same name
my $tx = $t->tx(POST => 'http://example.com' => form => {a => [qw(b c d)]});
# POST request with "multipart/form-data" content
my $tx = $t->tx(
Expand Down

0 comments on commit e942765

Please sign in to comment.