NAME
IO::Lambda::HTTP - http requests lambda style
DESCRIPTION
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.
SYNOPSIS
use
HTTP::Request;
lambda {
context
shift
;
http_request {
my
$result
=
shift
;
if
(
ref
(
$result
)) {
"good: "
,
length
(
$result
-> content),
" bytes\n"
;
}
else
{
"bad: $result\n"
;
}
}
}->
wait
(
);
API
- http_request $HTTP::Request -> $HTTP::Response
-
http_request
is a lambda condition that acceptsHTTP::Request
object in the context. Returns either aHTTP::Response
object on success, or error string otherwise. - new $HTTP::Request :: () -> $HTTP::Response
BUGS
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.
SEE ALSO
AUTHOR
Dmitry Karasik, <dmitry@karasik.eu.org>.