Skip to content

Commit

Permalink
more diverse JSON examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 9, 2015
1 parent 0dcc89d commit 72bb7c8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -361,7 +361,7 @@ Mojo::UserAgent - Non-blocking I/O HTTP and WebSocket user agent
use Mojo::UserAgent;
# Say hello to the Unicode snowman with Accept header
# Say hello to the Unicode snowman and include an Accept header
my $ua = Mojo::UserAgent->new;
say $ua->get('www.☃.net?hello=there' => {Accept => '*/*'})->res->body;
Expand All @@ -385,8 +385,7 @@ Mojo::UserAgent - Non-blocking I/O HTTP and WebSocket user agent
my $tx = $ua->put('[::1]:3000' => {'Content-Type' => 'text/plain'} => 'Hi!');
# Quick JSON API request with Basic authentication
say $ua->get('https://sri:s3cret@example.com/search.json?q=perl')
->res->json('/results/0/title');
my $value = $ua->get('https://sri:s3cret@example.com/test.json')->res->json;
# JSON POST (application/json) with TLS certificate authentication
my $tx = $ua->cert('tls.crt')->key('tls.key')
Expand Down

0 comments on commit 72bb7c8

Please sign in to comment.