diff options
author | Brian Phillips <bphillips@cpan.org> | 2012-12-04 22:53:27 -0600 |
---|---|---|
committer | Ash Berlin <ash_github@firemirror.com> | 2013-04-18 14:48:30 +0100 |
commit | 55f68bf78836700f664fd44cfedcee537627ac4e (patch) | |
tree | 62d75475dfc0495f843b4a9dd1903cd212b12bf0 /lib/Net/HTTP/Spore.pm | |
parent | Changes entry for adding PATCH support (Closes #13) (diff) | |
download | net-http-spore-55f68bf78836700f664fd44cfedcee537627ac4e.tar.gz |
support for anonymous middlewares
Diffstat (limited to 'lib/Net/HTTP/Spore.pm')
-rw-r--r-- | lib/Net/HTTP/Spore.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Net/HTTP/Spore.pm b/lib/Net/HTTP/Spore.pm index 38ba4f7..d4fd8af 100644 --- a/lib/Net/HTTP/Spore.pm +++ b/lib/Net/HTTP/Spore.pm @@ -192,6 +192,10 @@ or only on some path $client->enable_if(sub{$_->[0]->path =~ m!/path/to/json/stuff!}, 'Format::JSON'); +For very simple middlewares, you can simple pass in an anonymous function + + $client->enable( sub { my $request = shift; ... } ); + =head2 METHODS =over 4 |