--- AnyEvent-HTTP/HTTP.pm 2008/06/04 11:59:22 1.4 +++ AnyEvent-HTTP/HTTP.pm 2008/06/04 12:05:45 1.6 @@ -54,7 +54,12 @@ Executes an HTTP-GET request. See the http_request function for details on additional parameters. -=item http_get $url, $body, key => value..., $cb->($data, $headers) +=item http_head $url, key => value..., $cb->($data, $headers) + +Executes an HTTP-HEAD request. See the http_request function for details on +additional parameters. + +=item http_post $url, $body, key => value..., $cb->($data, $headers) Executes an HTTP-POST request with a requets body of C<$bod>. See the http_request function for details on additional parameters. @@ -77,6 +82,18 @@ then C<$data> will be C, C<< $headers->{Status} >> will be C<599> and the C pseudo-header will contain an error message. +A typical callback might look like this: + + sub { + my ($body, $hdr) = @_; + + if ($hdr->{Status} =~ /^2/) { + ... everything should be ok + } else { + print "error, $hdr->{Status} $hdr->{Reason}\n"; + } + } + Additional parameters are key-value pairs, and are fully optional. They include: