ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-HTTP/README
(Generate patch)

Comparing AnyEvent-HTTP/README (file contents):
Revision 1.2 by root, Thu Jun 5 18:42:16 2008 UTC vs.
Revision 1.3 by root, Thu Jun 12 11:56:09 2008 UTC

1NAME 1NAME
2 AnyEvent::HTTP - simple but non-blocking HTTP/HTTPS client 2 AnyEvent::HTTP - simple but non-blocking HTTP/HTTPS client
3 3
4SYNOPSIS 4SYNOPSIS
5 use AnyEvent::HTTP; 5 use AnyEvent::HTTP;
6
7 http_get "http://www.nethype.de/", sub { print $_[1] };
8
9 # ... do something else here
6 10
7DESCRIPTION 11DESCRIPTION
8 This module is an AnyEvent user, you need to make sure that you use and 12 This module is an AnyEvent user, you need to make sure that you use and
9 run a supported event loop. 13 run a supported event loop.
10 14
43 The callback will be called with the response data as first argument 47 The callback will be called with the response data as first argument
44 (or "undef" if it wasn't available due to errors), and a hash-ref 48 (or "undef" if it wasn't available due to errors), and a hash-ref
45 with response headers as second argument. 49 with response headers as second argument.
46 50
47 All the headers in that hash are lowercased. In addition to the 51 All the headers in that hash are lowercased. In addition to the
48 response headers, the three "pseudo-headers" "HTTPVersion", "Status" 52 response headers, the "pseudo-headers" "HTTPVersion", "Status" and
49 and "Reason" contain the three parts of the HTTP Status-Line of the 53 "Reason" contain the three parts of the HTTP Status-Line of the same
54 name. The pseudo-header "URL" contains the original URL (which can
55 differ from the requested URL when following redirects).
56
50 same name. If the server sends a header multiple lines, then their 57 If the server sends a header multiple lines, then their contents
51 contents will be joined together with "\x00". 58 will be joined together with "\x00".
52 59
53 If an internal error occurs, such as not being able to resolve a 60 If an internal error occurs, such as not being able to resolve a
54 hostname, then $data will be "undef", "$headers->{Status}" will be 61 hostname, then $data will be "undef", "$headers->{Status}" will be
55 599 and the "Reason" pseudo-header will contain an error message. 62 599 and the "Reason" pseudo-header will contain an error message.
56 63
166 173
167SEE ALSO 174SEE ALSO
168 AnyEvent. 175 AnyEvent.
169 176
170AUTHOR 177AUTHOR
171 Marc Lehmann <schmorp@schmorp.de> 178 Marc Lehmann <schmorp@schmorp.de>
172 http://home.schmorp.de/ 179 http://home.schmorp.de/
173 180

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines