Skip to content

Instantly share code, notes, and snippets.

@renatocron
Created August 25, 2016 13:05
Show Gist options
  • Save renatocron/bd3a3f8c9d35bca0ab1c799de62fa4f5 to your computer and use it in GitHub Desktop.
Save renatocron/bd3a3f8c9d35bca0ab1c799de62fa4f5 to your computer and use it in GitHub Desktop.
use strict;
use HTTP::Async;
use HTTP::Request;
use IO::Socket::SSL qw(debug4);
use URI;
my $async = HTTP::Async->new( );
my $a = HTTP::Request->new(
GET => 'https://eokoe.com',
[
]
);
print STDERR $a->as_string;
# create some requests and add them to the queue.
$async->add($a);
while ( $async->not_empty ) {
if ( my $response = $async->next_response ) {
print STDERR $response->as_string;
}
else {
# do something else
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment