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

Comparing AnyEvent-HTTP/HTTP.pm (file contents):
Revision 1.44 by root, Tue Jul 7 00:15:32 2009 UTC vs.
Revision 1.45 by root, Fri Jul 17 16:56:36 2009 UTC

221This callback is useful when the data is too large to be held in memory 221This callback is useful when the data is too large to be held in memory
222(so the callback writes it to a file) or when only some information should 222(so the callback writes it to a file) or when only some information should
223be extracted, or when the body should be processed incrementally. 223be extracted, or when the body should be processed incrementally.
224 224
225It is usually preferred over doing your own body handling via 225It is usually preferred over doing your own body handling via
226C<want_body_handle>. 226C<want_body_handle>, but in case of streaming APIs, where HTTP is
227only used to create a connection, C<want_body_handle> is the better
228alternative, as it allows you to install your own event handler, reducing
229resource usage.
227 230
228=item want_body_handle => $enable 231=item want_body_handle => $enable
229 232
230When enabled (default is disabled), the behaviour of AnyEvent::HTTP 233When enabled (default is disabled), the behaviour of AnyEvent::HTTP
231changes considerably: after parsing the headers, and instead of 234changes considerably: after parsing the headers, and instead of
243This is useful with some push-type services, where, after the initial 246This is useful with some push-type services, where, after the initial
244headers, an interactive protocol is used (typical example would be the 247headers, an interactive protocol is used (typical example would be the
245push-style twitter API which starts a JSON/XML stream). 248push-style twitter API which starts a JSON/XML stream).
246 249
247If you think you need this, first have a look at C<on_body>, to see if 250If you think you need this, first have a look at C<on_body>, to see if
248that doesn'T solve your problem in a better way. 251that doesn't solve your problem in a better way.
249 252
250=back 253=back
251 254
252Example: make a simple HTTP GET request for http://www.nethype.de/ 255Example: make a simple HTTP GET request for http://www.nethype.de/
253 256

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines