--- AnyEvent-HTTP/HTTP.pm 2008/06/04 12:03:47 1.5 +++ AnyEvent-HTTP/HTTP.pm 2008/06/04 12:05:45 1.6 @@ -82,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: