--- AnyEvent-HTTP/HTTP.pm 2008/06/04 11:58:36 1.3 +++ AnyEvent-HTTP/HTTP.pm 2008/06/04 11:59:22 1.4 @@ -243,7 +243,10 @@ substr $_, 0, 1, "" for values %hdr; - if ($method ne "HEAD") { + if ($method eq "HEAD") { + %state = (); + $cb->(undef, \%hdr); + } else { if (exists $hdr{"content-length"}) { $_[0]->unshift_read (chunk => $hdr{"content-length"}, sub { # could cache persistent connection now @@ -279,6 +282,11 @@ &http_request } +sub http_head($$;@) { + unshift @_, "HEAD"; + &http_request +} + sub http_post($$$;@) { unshift @_, "POST", "body"; &http_request