Skip to content

Commit

Permalink
use a slightly more descriptive example
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 8, 2016
1 parent 700e546 commit ae2a696
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

7.12 2016-12-03
7.12 2016-12-09

7.11 2016-11-30
- Added EXPERIMENTAL close_idle_connections method to Mojo::Server::Daemon.
Expand Down
16 changes: 8 additions & 8 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -642,7 +642,7 @@ implements the following new ones.
my $tx = $ua->build_tx(GET => 'example.com');
my $tx = $ua->build_tx(
PUT => 'http://example.com' => {Accept => '*/*'} => 'Hi!');
PUT => 'http://example.com' => {Accept => '*/*'} => 'Content!');
my $tx = $ua->build_tx(
PUT => 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
my $tx = $ua->build_tx(
Expand Down Expand Up @@ -697,7 +697,7 @@ L<Mojo::UserAgent::Transactor/"websocket">.
=head2 delete
my $tx = $ua->delete('example.com');
my $tx = $ua->delete('http://example.com' => {Accept => '*/*'} => 'Hi!');
my $tx = $ua->delete('http://example.com' => {Accept => '*/*'} => 'Content!');
my $tx = $ua->delete(
'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
my $tx = $ua->delete(
Expand All @@ -717,7 +717,7 @@ implied). You can also append a callback to perform requests non-blocking.
=head2 get
my $tx = $ua->get('example.com');
my $tx = $ua->get('http://example.com' => {Accept => '*/*'} => 'Hi!');
my $tx = $ua->get('http://example.com' => {Accept => '*/*'} => 'Content!');
my $tx = $ua->get(
'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
my $tx = $ua->get(
Expand All @@ -737,7 +737,7 @@ perform requests non-blocking.
=head2 head
my $tx = $ua->head('example.com');
my $tx = $ua->head('http://example.com' => {Accept => '*/*'} => 'Hi!');
my $tx = $ua->head('http://example.com' => {Accept => '*/*'} => 'Content!');
my $tx = $ua->head(
'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
my $tx = $ua->head(
Expand All @@ -757,7 +757,7 @@ implied). You can also append a callback to perform requests non-blocking.
=head2 options
my $tx = $ua->options('example.com');
my $tx = $ua->options('http://example.com' => {Accept => '*/*'} => 'Hi!');
my $tx = $ua->options('http://example.com' => {Accept => '*/*'} => 'Content!');
my $tx = $ua->options(
'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
my $tx = $ua->options(
Expand All @@ -777,7 +777,7 @@ implied). You can also append a callback to perform requests non-blocking.
=head2 patch
my $tx = $ua->patch('example.com');
my $tx = $ua->patch('http://example.com' => {Accept => '*/*'} => 'Hi!');
my $tx = $ua->patch('http://example.com' => {Accept => '*/*'} => 'Content!');
my $tx = $ua->patch(
'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
my $tx = $ua->patch(
Expand All @@ -797,7 +797,7 @@ implied). You can also append a callback to perform requests non-blocking.
=head2 post
my $tx = $ua->post('example.com');
my $tx = $ua->post('http://example.com' => {Accept => '*/*'} => 'Hi!');
my $tx = $ua->post('http://example.com' => {Accept => '*/*'} => 'Content!');
my $tx = $ua->post(
'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
my $tx = $ua->post(
Expand All @@ -817,7 +817,7 @@ implied). You can also append a callback to perform requests non-blocking.
=head2 put
my $tx = $ua->put('example.com');
my $tx = $ua->put('http://example.com' => {Accept => '*/*'} => 'Hi!');
my $tx = $ua->put('http://example.com' => {Accept => '*/*'} => 'Content!');
my $tx = $ua->put(
'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
my $tx = $ua->put(
Expand Down
5 changes: 3 additions & 2 deletions lib/Mojo/UserAgent/Transactor.pm
Expand Up @@ -366,10 +366,11 @@ C<307> or C<308> redirect response if possible.
my $tx = $t->tx(GET => 'example.com');
my $tx = $t->tx(POST => 'http://example.com');
my $tx = $t->tx(GET => 'http://example.com' => {Accept => '*/*'});
my $tx = $t->tx(PUT => 'http://example.com' => 'Hi!');
my $tx = $t->tx(PUT => 'http://example.com' => 'Content!');
my $tx = $t->tx(PUT => 'http://example.com' => form => {a => 'b'});
my $tx = $t->tx(PUT => 'http://example.com' => json => {a => 'b'});
my $tx = $t->tx(POST => 'http://example.com' => {Accept => '*/*'} => 'Hi!');
my $tx = $t->tx(
POST => 'http://example.com' => {Accept => '*/*'} => 'Content!');
my $tx = $t->tx(
PUT => 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
my $tx = $t->tx(
Expand Down
14 changes: 7 additions & 7 deletions lib/Test/Mojo.pm
Expand Up @@ -629,7 +629,7 @@ Opposite of L</"content_like">.
$t = $t->delete_ok('http://example.com/foo');
$t = $t->delete_ok('/foo');
$t = $t->delete_ok('/foo' => {Accept => '*/*'} => 'Hi!');
$t = $t->delete_ok('/foo' => {Accept => '*/*'} => 'Content!');
$t = $t->delete_ok('/foo' => {Accept => '*/*'} => form => {a => 'b'});
$t = $t->delete_ok('/foo' => {Accept => '*/*'} => json => {a => 'b'});
Expand Down Expand Up @@ -685,7 +685,7 @@ Wait for WebSocket connection to be closed gracefully and check status.
$t = $t->get_ok('http://example.com/foo');
$t = $t->get_ok('/foo');
$t = $t->get_ok('/foo' => {Accept => '*/*'} => 'Hi!');
$t = $t->get_ok('/foo' => {Accept => '*/*'} => 'Content!');
$t = $t->get_ok('/foo' => {Accept => '*/*'} => form => {a => 'b'});
$t = $t->get_ok('/foo' => {Accept => '*/*'} => json => {a => 'b'});
Expand All @@ -708,7 +708,7 @@ arguments as L<Mojo::UserAgent/"get">, except for the callback.
$t = $t->head_ok('http://example.com/foo');
$t = $t->head_ok('/foo');
$t = $t->head_ok('/foo' => {Accept => '*/*'} => 'Hi!');
$t = $t->head_ok('/foo' => {Accept => '*/*'} => 'Content!');
$t = $t->head_ok('/foo' => {Accept => '*/*'} => form => {a => 'b'});
$t = $t->head_ok('/foo' => {Accept => '*/*'} => json => {a => 'b'});
Expand Down Expand Up @@ -884,7 +884,7 @@ Construct a new L<Test::Mojo> object.
$t = $t->options_ok('http://example.com/foo');
$t = $t->options_ok('/foo');
$t = $t->options_ok('/foo' => {Accept => '*/*'} => 'Hi!');
$t = $t->options_ok('/foo' => {Accept => '*/*'} => 'Content!');
$t = $t->options_ok('/foo' => {Accept => '*/*'} => form => {a => 'b'});
$t = $t->options_ok('/foo' => {Accept => '*/*'} => json => {a => 'b'});
Expand All @@ -905,7 +905,7 @@ Execute callback if the value of L</"success"> is false.
$t = $t->patch_ok('http://example.com/foo');
$t = $t->patch_ok('/foo');
$t = $t->patch_ok('/foo' => {Accept => '*/*'} => 'Hi!');
$t = $t->patch_ok('/foo' => {Accept => '*/*'} => 'Content!');
$t = $t->patch_ok('/foo' => {Accept => '*/*'} => form => {a => 'b'});
$t = $t->patch_ok('/foo' => {Accept => '*/*'} => json => {a => 'b'});
Expand All @@ -916,7 +916,7 @@ arguments as L<Mojo::UserAgent/"patch">, except for the callback.
$t = $t->post_ok('http://example.com/foo');
$t = $t->post_ok('/foo');
$t = $t->post_ok('/foo' => {Accept => '*/*'} => 'Hi!');
$t = $t->post_ok('/foo' => {Accept => '*/*'} => 'Content!');
$t = $t->post_ok('/foo' => {Accept => '*/*'} => form => {a => 'b'});
$t = $t->post_ok('/foo' => {Accept => '*/*'} => json => {a => 'b'});
Expand All @@ -936,7 +936,7 @@ arguments as L<Mojo::UserAgent/"post">, except for the callback.
$t = $t->put_ok('http://example.com/foo');
$t = $t->put_ok('/foo');
$t = $t->put_ok('/foo' => {Accept => '*/*'} => 'Hi!');
$t = $t->put_ok('/foo' => {Accept => '*/*'} => 'Content!');
$t = $t->put_ok('/foo' => {Accept => '*/*'} => form => {a => 'b'});
$t = $t->put_ok('/foo' => {Accept => '*/*'} => json => {a => 'b'});
Expand Down

0 comments on commit ae2a696

Please sign in to comment.