Future...tAsync(3pm)
π Future::HTTP::NetAsync β the vibe β¨
okay bestie, so this page is Future...tAsync(3pm) from the User Contributed Perl Documentation, and it's about Future::HTTP::NetAsync β an asynchronous HTTP client that speaks Future. yes, it's giving main character energy. come sit with me π«Ά
πΈ NAME πΈ
Future::HTTP::NetAsync β an asynchronous HTTP client with a Future interface π
β¨ DESCRIPTION β¨
This is the backend when running with IO::Async. It will execute the requests asynchronously. no blocking, no waiting around like a loser, the requests just go do their thing π¦
π METHODS π
π
Future::HTTP::NetAsync->new()
my $ua = Future::HTTP::NetAsync->new();
Creates a new instance of the HTTP client. that's it, that's the constructor, it's iconic for being simple π
π
$ua->is_async()
Returns true, because this backend is asynchronous. like obviously, it's literally in the name bestie π
π
$ua->http_get($url, %options)
$ua->http_get('http://example.com/',
headers => {
'Accept' => 'text/json',
},
)->then(sub {
my( $body, $headers ) = @_;
...
});
Retrieves the URL and returns the body and headers, like the function in AnyEvent::HTTP. so you get both the body and the headers, no cap π
π
$ua->http_head($url, %options)
$ua->http_head('http://example.com/',
headers => {
'Accept' => 'text/json',
},
)->then(sub {
my( $body, $headers ) = @_;
...
});
Retrieves the header of the URL and returns the headers, like the function in AnyEvent::HTTP. heads up (pun fully intended, I'm hilarious): this one's the HEAD request vibe πΈ
π
$ua->http_post($url, $body, %options)
$ua->http_post('http://example.com/api',
'{token:"my_json_token"}',
headers => {
'Accept' => 'text/json',
},
)->then(sub {
my( $body, $headers ) = @_;
...
});
Posts the content to the URL and returns the body and headers, like the function in AnyEvent::HTTP. sending data out into the world, slay π¦
π
$ua->http_request($method, $url, %options)
$ua->http_request('PUT' => 'http://example.com/api',
headers => {
'Accept' => 'text/json',
},
body => '{token:"my_json_token"}',
)->then(sub {
my( $body, $headers ) = @_;
...
});
Posts the content to the URL and returns the body and headers, like the function in AnyEvent::HTTP. this is the one where you pick the $method β yes, you, the main character β¨
okay important lil heads-up: Note that this subclass will automatically collect cookies. This may or may not be the behaviour you want. so like... it's out here hoarding cookies like it's a snack stash π, and that might be exactly what you want or it might absolutely Not be. decide accordingly, bestie π
π SEE ALSO π
FutureAnyEvent::HTTPfor the details of the APINet::Async::HTTPfor the backend
π REPOSITORY π
The public repository of this module is <https://github.com/Corion/future-http>. go star it, it's giving community π
π«Ά SUPPORT π«Ά
The public support forum of this module is <https://perlmonks.org/>. the monks are lowkey legendary, fr fr π§
π BUG TRACKER π
Please report bugs in this module via the RT CPAN bug queue at <https://rt.cpan.org/Public/Dist/Display.html?Name=Future-HTTP> or via mail to future-http-Bugs@cpan.org. found a bug? tell on it, don't suffer in silence π
π AUTHOR π
Max Maischein "corion@cpan.org" β the icon behind all this π
π COPYRIGHT (c) π
Copyright 2016-2024 by Max Maischein "corion@cpan.org".
β LICENSE β
This module is released under the same terms as Perl itself. periodt π
so yeah, that's the whole page bestie β documented by User Contributed Perl Documentation, running on perl v5.40.1, dated 2026-01-14 π go forth and make asynchronous requests, you absolute legend π
π¦ where this page comes from
- ubuntu resolute: libfuture-http-perl 0.17-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libfuture-http-perl 0.17-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms