Future...::Mojo(3pm)
๐ธ Future...::Mojo(3pm) ๐ธ
okay bestie, welcome to the manual page for Future::HTTP::Mojo โ it's part of the User Contributed Perl Documentation crew, and it's here to make your HTTP requests go zoom asynchronously. it's also filed under Future...::Mojo(3pm) in the man pages, so if you were looking for that name, you found her ๐
โจ NAME โจ
Future::HTTP::Mojo - asynchronous HTTP client with a Future interface ๐ฆ
๐ DESCRIPTION ๐
so here's the vibe: this is the backend you get when you're running with Mojo::IOLoop. it will execute the requests asynchronously. no cap, that's literally the whole point. โจ
๐ METHODS ๐
๐
Future::HTTP::Mojo->new()
my $ua = Future::HTTP::Mojo->new();
Creates a new instance of the HTTP client. new ua, who dis ๐ซถ
โญ $ua->is_async()
Returns true, because this backend is asynchronous. it's giving async main character energy, periodt. ๐
๐ $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, exactly like the function in AnyEvent::HTTP. then you .then on it and do your lil thing ๐
๐ฆ $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 (no body, head only, we're keeping it mysterious), just like the function in AnyEvent::HTTP. ๐
๐ $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, same as the function in AnyEvent::HTTP. sending it fr fr ๐ฎ
๐ง $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 your any-method wildcard girlie ๐
โ ๏ธ heads up bestie: note that this subclass will automatically collect cookies. This may or may not be the behaviour you want. so likeโฆ vibe check that before you ship it ๐ญ
๐ฅ SEE ALSO ๐ฅ
- Future
- AnyEvent::HTTP for the details of the API
- Mojo::UserAgent for the backend
๐ REPOSITORY ๐
The public repository of this module is <http://github.com/Corion/future-http>. go star it, it's iconic โญ
๐ซถ SUPPORT ๐ซถ
The public support forum of this module is <https://perlmonks.org/>. the monks are lowkey the bestie collective, go say hi ๐ง
๐ 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@rt.cpan.org. not me asking you to file good bug reports, please and thank you ๐
๐ AUTHOR ๐
Max Maischein "corion@cpan.org"
๐ COPYRIGHT (c) ๐
Copyright 2016-2024 by Max Maischein "corion@cpan.org".
๐ธ LICENSE ๐ธ
This module is released under the same terms as Perl itself. slay, licensing handled โ
and that's the whole page, bestie โ written against perl v5.40.1, dated 2026-01-14, filed under the Future...::Mojo(3pm) manual page. go make some async requests, you've got this ๐
โจ
๐ฆ 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