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.25 by root, Mon Jul 21 05:42:07 2008 UTC vs.
Revision 1.28 by root, Mon Sep 29 13:50:39 2008 UTC

48use AnyEvent::Socket (); 48use AnyEvent::Socket ();
49use AnyEvent::Handle (); 49use AnyEvent::Handle ();
50 50
51use base Exporter::; 51use base Exporter::;
52 52
53our $VERSION = '1.03'; 53our $VERSION = '1.05';
54 54
55our @EXPORT = qw(http_get http_post http_head http_request); 55our @EXPORT = qw(http_get http_post http_head http_request);
56 56
57our $USERAGENT = "Mozilla/5.0 (compatible; AnyEvent::HTTP/$VERSION; +http://software.schmorp.de/pkg/AnyEvent)"; 57our $USERAGENT = "Mozilla/5.0 (compatible; AnyEvent::HTTP/$VERSION; +http://software.schmorp.de/pkg/AnyEvent)";
58our $MAX_RECURSE = 10; 58our $MAX_RECURSE = 10;
80Executes an HTTP-HEAD request. See the http_request function for details on 80Executes an HTTP-HEAD request. See the http_request function for details on
81additional parameters. 81additional parameters.
82 82
83=item http_post $url, $body, key => value..., $cb->($data, $headers) 83=item http_post $url, $body, key => value..., $cb->($data, $headers)
84 84
85Executes an HTTP-POST request with a request body of C<$bod>. See the 85Executes an HTTP-POST request with a request body of C<$body>. See the
86http_request function for details on additional parameters. 86http_request function for details on additional parameters.
87 87
88=item http_request $method => $url, key => value..., $cb->($data, $headers) 88=item http_request $method => $url, key => value..., $cb->($data, $headers)
89 89
90Executes a HTTP request of type C<$method> (e.g. C<GET>, C<POST>). The URL 90Executes a HTTP request of type C<$method> (e.g. C<GET>, C<POST>). The URL
398 my %kv = (value => $value, map { split /=/, $_, 2 } @arg); 398 my %kv = (value => $value, map { split /=/, $_, 2 } @arg);
399 399
400 my $cdom = (delete $kv{domain}) || $uhost; 400 my $cdom = (delete $kv{domain}) || $uhost;
401 my $cpath = (delete $kv{path}) || "/"; 401 my $cpath = (delete $kv{path}) || "/";
402 402
403 $cdom =~ s/^.?/./; # make sure it starts with a "." 403 $cdom =~ s/^\.?/./; # make sure it starts with a "."
404 404
405 next if $cdom =~ /\.$/; 405 next if $cdom =~ /\.$/;
406 406
407 # this is not rfc-like and not netscape-like. go figure. 407 # this is not rfc-like and not netscape-like. go figure.
408 my $ndots = $cdom =~ y/.//; 408 my $ndots = $cdom =~ y/.//;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines