Skip to content

Commit

Permalink
add an example for a mock web service
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 27, 2015
1 parent 8ea4618 commit 1ee8b10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

6.26 2015-10-26
6.26 2015-10-27

6.25 2015-10-21
- Deprecated Mojo::Message::Request::proxy with boolean and string arguments
Expand Down
7 changes: 7 additions & 0 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -620,6 +620,13 @@ The timeout will reset for every followed redirect.
Application server relative URLs will be processed with, defaults to a
L<Mojo::UserAgent::Server> object.
# Mock web service
$ua->server->app->get('/time' => sub {
my $c = shift;
$c->render({now => time});
});
my $time = $ua->get('/time')->res->json->{now};
# Introspect
say for @{$ua->server->app->secrets};
Expand Down

0 comments on commit 1ee8b10

Please sign in to comment.