--- AnyEvent-HTTP/README 2008/06/05 18:42:16 1.2 +++ AnyEvent-HTTP/README 2008/07/24 06:01:10 1.4 @@ -4,6 +4,10 @@ SYNOPSIS use AnyEvent::HTTP; + http_get "http://www.nethype.de/", sub { print $_[1] }; + + # ... do something else here + DESCRIPTION This module is an AnyEvent user, you need to make sure that you use and run a supported event loop. @@ -33,7 +37,7 @@ details on additional parameters. http_post $url, $body, key => value..., $cb->($data, $headers) - Executes an HTTP-POST request with a request body of $bod. See the + Executes an HTTP-POST request with a request body of $body. See the http_request function for details on additional parameters. http_request $method => $url, key => value..., $cb->($data, $headers) @@ -45,10 +49,13 @@ with response headers as second argument. All the headers in that hash are lowercased. In addition to the - response headers, the three "pseudo-headers" "HTTPVersion", "Status" - and "Reason" contain the three parts of the HTTP Status-Line of the - same name. If the server sends a header multiple lines, then their - contents will be joined together with "\x00". + response headers, the "pseudo-headers" "HTTPVersion", "Status" and + "Reason" contain the three parts of the HTTP Status-Line of the same + name. The pseudo-header "URL" contains the original URL (which can + differ from the requested URL when following redirects). + + If the server sends a header multiple lines, then their contents + will be joined together with "\x00". If an internal error occurs, such as not being able to resolve a hostname, then $data will be "undef", "$headers->{Status}" will be @@ -168,6 +175,6 @@ AnyEvent. AUTHOR - Marc Lehmann - http://home.schmorp.de/ + Marc Lehmann + http://home.schmorp.de/