IO::Lambda::HTTP(3)

πŸ“¦ version 1.34, in alpine 3.24

πŸ’– IO::Lambda::HTTP(3) β€” http requests, lambda style πŸ’…

okay so bestie, this is the IO::Lambda::HTTP(3) page β€” a Perl module that makes HTTP requests the lambda way ✨


🌸 NAME 🌸

IO::Lambda::HTTP β€” http requests lambda style, no cap πŸ¦‹


πŸŽ€ DESCRIPTION πŸŽ€

The module exports a single condition called http_request that accepts a HTTP::Request object plus a set of options as parameters. The way that it works: the condition returns either an HTTP::Response on success, or an error string otherwise. That's the whole vibe. Simple, iconic, periodt πŸ‘‘


✨ SYNOPSIS ✨

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/")
);

literally the whole flow right there 🫢


πŸ’œ API πŸ’œ

⭐ http_request $HTTP::Request -> $HTTP::Response

http_request is a lambda condition that accepts a HTTP::Request object in the context. It returns either a HTTP::Response object on success, or an error string otherwise. That's the deal β€” ref check it and you'll know which one you got 😭

πŸ¦‹ new $HTTP::Request :: () -> $HTTP::Response

See "new" in IO::Lambda::HTTP::Client πŸ‘€


πŸ’€ BUGS πŸ’€

Non-blocking connects β€” and honestly, the whole module because of that β€” don't work on win32 on perl5.8.X, thanks to an under-implementation in ext/IO.xs. They do work on 5.10 however. so like... upgrade, bestie πŸ™ˆ


🌈 SEE ALSO 🌈

  • IO::Lambda::HTTP::Client β€” go read it, iykyk

πŸ‘‘ AUTHOR πŸ‘‘

Dmitry Karasik, <dmitry@karasik.eu.org>. king behavior, fr fr πŸŽ€


that's the whole page, bestie β€” perl v5.42.2, dated 2026-02-15, served fresh by whoever packaged this gem πŸ’– go make some requests, you got this 🌟

πŸ“¦ where this page comes from