… | |
… | |
48 | use AnyEvent::Socket (); |
48 | use AnyEvent::Socket (); |
49 | use AnyEvent::Handle (); |
49 | use AnyEvent::Handle (); |
50 | |
50 | |
51 | use base Exporter::; |
51 | use base Exporter::; |
52 | |
52 | |
53 | our $VERSION = '1.02'; |
53 | our $VERSION = '1.03'; |
54 | |
54 | |
55 | our @EXPORT = qw(http_get http_post http_head http_request); |
55 | our @EXPORT = qw(http_get http_post http_head http_request); |
56 | |
56 | |
57 | our $USERAGENT = "Mozilla/5.0 (compatible; AnyEvent::HTTP/$VERSION; +http://software.schmorp.de/pkg/AnyEvent)"; |
57 | our $USERAGENT = "Mozilla/5.0 (compatible; AnyEvent::HTTP/$VERSION; +http://software.schmorp.de/pkg/AnyEvent)"; |
58 | our $MAX_RECURSE = 10; |
58 | our $MAX_RECURSE = 10; |
… | |
… | |
466 | unshift @_, "HEAD"; |
466 | unshift @_, "HEAD"; |
467 | &http_request |
467 | &http_request |
468 | } |
468 | } |
469 | |
469 | |
470 | sub http_post($$@) { |
470 | sub http_post($$@) { |
|
|
471 | my $url = shift; |
471 | unshift @_, "POST", "body"; |
472 | unshift @_, "POST", $url, "body"; |
472 | &http_request |
473 | &http_request |
473 | } |
474 | } |
474 | |
475 | |
475 | =back |
476 | =back |
476 | |
477 | |