Future::HTTP::AnyEvent - asynchronous HTTP client with a Future interface
This is the backend chosen if AnyEvent.pm or AE.pm are detected in %INC. It will execute the requests asynchronously using AnyEvent::HTTP.
%INC
Future::HTTP::AnyEvent->new()
my $ua = Future::HTTP::AnyEvent->new();
Creates a new instance of the HTTP client.
$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.
$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.
$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.
$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 ) = @_; ... });
Future
AnyEvent::HTTP for the details of the API
The public repository of this module is http://github.com/Corion/future-http.
The public support forum of this module is https://perlmonks.org/.
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.
Max Maischein corion@cpan.org
corion@cpan.org
Copyright 2016 by Max Maischein corion@cpan.org.
This module is released under the same terms as Perl itself.
To install Future::HTTP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Future::HTTP
CPAN shell
perl -MCPAN -e shell install Future::HTTP
For more information on module installation, please visit the detailed CPAN module installation guide.