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.108 by root, Thu Jun 30 09:12:39 2011 UTC vs.
Revision 1.109 by root, Wed Jul 27 16:11:55 2011 UTC

46use AnyEvent::Util (); 46use AnyEvent::Util ();
47use AnyEvent::Handle (); 47use AnyEvent::Handle ();
48 48
49use base Exporter::; 49use base Exporter::;
50 50
51our $VERSION = '2.12'; 51our $VERSION = '2.13';
52 52
53our @EXPORT = qw(http_get http_post http_head http_request); 53our @EXPORT = qw(http_get http_post http_head http_request);
54 54
55our $USERAGENT = "Mozilla/5.0 (compatible; U; AnyEvent-HTTP/$VERSION; +http://software.schmorp.de/pkg/AnyEvent)"; 55our $USERAGENT = "Mozilla/5.0 (compatible; U; AnyEvent-HTTP/$VERSION; +http://software.schmorp.de/pkg/AnyEvent)";
56our $MAX_RECURSE = 10; 56our $MAX_RECURSE = 10;
384 384
385Example: do a HTTP HEAD request on https://www.google.com/, use a 385Example: do a HTTP HEAD request on https://www.google.com/, use a
386timeout of 30 seconds. 386timeout of 30 seconds.
387 387
388 http_request 388 http_request
389 GET => "https://www.google.com", 389 HEAD => "https://www.google.com",
390 headers => { "user-agent" => "MySearchClient 1.0" }, 390 headers => { "user-agent" => "MySearchClient 1.0" },
391 timeout => 30, 391 timeout => 30,
392 sub { 392 sub {
393 my ($body, $hdr) = @_; 393 my ($body, $hdr) = @_;
394 use Data::Dumper; 394 use Data::Dumper;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines