Subject: | HEAD requests never return |
This program never returns. If you change the "HEAD" to a "GET" it works
fine:
#!/usr/bin/perl -wT
use strict;
use warnings;
use diagnostics;
use HTTP::Request;
use IO::Lambda qw(:lambda);
use IO::Lambda::HTTP qw(http_request);
lambda {
context(
HTTP::Request-> new(HEAD => 'http://www.google.com'),
async_dns => 1,
keep_alive => 1,
proxy => [ '192.168.1.1', '3128' ],
);
http_request {
my $res = shift;
if ( ref($res) and ref($res) eq 'HTTP::Response') {
print "google: ", length($res-> content), " bytes\n";
} else {
print "google: error :$res\n";
}
}
}-> wait;