IO::Lambda::HTTP - http requests lambda style
The module exports a single condition http_request that accepts a HTTP::Request object and set of options as parameters. The condition returns either a HTTP::Response on success, or an error string otherwise.
http_request
HTTP::Request
HTTP::Response
use HTTP::Request; use IO::Lambda qw(:all); use IO::Lambda::HTTP qw(http_request); lambda { context shift; http_request { my $result = shift; if ( ref($result)) { print "good: ", length($result-> content), " bytes\n"; } else { print "bad: $result\n"; } } }-> wait( HTTP::Request-> new( GET => "http://www.perl.com/") );
http_request is a lambda condition that accepts HTTP::Request object in the context. Returns either a HTTP::Response object on success, or error string otherwise.
See "new" in IO::Lambda::HTTP::Client
Non-blocking connects, and hence the module, don't work on win32 on perl5.8.X due to under-implementation in ext/IO.xs. They do work on 5.10 however.
IO::Lambda::HTTP::Client
Dmitry Karasik, <dmitry@karasik.eu.org>.
To install IO::Lambda, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IO::Lambda
CPAN shell
perl -MCPAN -e shell install IO::Lambda
For more information on module installation, please visit the detailed CPAN module installation guide.