On Sun Aug 04 07:33:51 2013, AERDAN wrote:
Show quoted text> Net::Async::HTTP should, when ->do_request is called with a request
> object, pull the host, port, and SSL usage from the ->uri method on
> HTTP::Request objects. If the object doesn't have such data, then it
> can require at least the host keyword argument. Currently, it requires
> the host argument always.
This should already be happening:
HTTP.pm:
641 my $uri = $request->uri;
642 if( defined $uri->scheme and $uri->scheme =~ m/^http(s?)$/ ) {
643 $host = $uri->host if !defined $host;
644 $port = $uri->port if !defined $port;
645 $ssl = ( $uri->scheme eq "https" );
646 }
And works as advertised:
$ perlsh -b
eval: use IO::Async::Loop;
undef
eval: use Net::Async::HTTP;
undef
eval: IO::Async::Loop->new->add( my $http = Net::Async::HTTP->new );
undef
eval: $http->do_request( request => HTTP::Request->new( GET => "
http://www.google.com" ) )->get->content_type
'text/html'
--
Paul Evans