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.136 by root, Wed Oct 16 01:20:02 2019 UTC vs.
Revision 1.140 by root, Wed Mar 6 19:29:18 2024 UTC

4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 use AnyEvent::HTTP; 7 use AnyEvent::HTTP;
8 8
9 http_get "http://www.nethype.de/", sub { print $_[1] }; 9 http_get "http://www.nethype.de/", sub {
10 my ($body, $hdr) = @_;
11 print "$hdr->{URL} Status: $hdr->{Status}\n";
12 print $body;
13 };
10 14
11 # ... do something else here 15 # ... do something else here
12 16
13=head1 DESCRIPTION 17=head1 DESCRIPTION
14 18
46use AnyEvent::Util (); 50use AnyEvent::Util ();
47use AnyEvent::Handle (); 51use AnyEvent::Handle ();
48 52
49use base Exporter::; 53use base Exporter::;
50 54
51our $VERSION = 2.24; 55our $VERSION = 2.25;
52 56
53our @EXPORT = qw(http_get http_post http_head http_request); 57our @EXPORT = qw(http_get http_post http_head http_request);
54 58
55our $USERAGENT = "Mozilla/5.0 (compatible; U; AnyEvent-HTTP/$VERSION; +http://software.schmorp.de/pkg/AnyEvent)"; 59our $USERAGENT = "Mozilla/5.0 (compatible; U; AnyEvent-HTTP/$VERSION; +http://software.schmorp.de/pkg/AnyEvent)";
56our $MAX_RECURSE = 10; 60our $MAX_RECURSE = 10;
716} 720}
717 721
718our %IDEMPOTENT = ( 722our %IDEMPOTENT = (
719 DELETE => 1, 723 DELETE => 1,
720 GET => 1, 724 GET => 1,
725 QUERY => 1,
721 HEAD => 1, 726 HEAD => 1,
722 OPTIONS => 1, 727 OPTIONS => 1,
723 PUT => 1, 728 PUT => 1,
724 TRACE => 1, 729 TRACE => 1,
725 730
737 MKCOL => 1, 742 MKCOL => 1,
738 MKREDIRECTREF => 1, 743 MKREDIRECTREF => 1,
739 MKWORKSPACE => 1, 744 MKWORKSPACE => 1,
740 MOVE => 1, 745 MOVE => 1,
741 ORDERPATCH => 1, 746 ORDERPATCH => 1,
747 PRI => 1,
742 PROPFIND => 1, 748 PROPFIND => 1,
743 PROPPATCH => 1, 749 PROPPATCH => 1,
744 REBIND => 1, 750 REBIND => 1,
745 REPORT => 1, 751 REPORT => 1,
746 SEARCH => 1, 752 SEARCH => 1,
1238# $state{handle}->destroyed 1244# $state{handle}->destroyed
1239# and die "AnyEvent::HTTP: unexpectedly got a destructed handle (1), please report.";#d# 1245# and die "AnyEvent::HTTP: unexpectedly got a destructed handle (1), please report.";#d#
1240 $prepare_handle->(); 1246 $prepare_handle->();
1241# $state{handle}->destroyed 1247# $state{handle}->destroyed
1242# and die "AnyEvent::HTTP: unexpectedly got a destructed handle (2), please report.";#d# 1248# and die "AnyEvent::HTTP: unexpectedly got a destructed handle (2), please report.";#d#
1249 $rpath = $upath;
1243 $handle_actual_request->(); 1250 $handle_actual_request->();
1244 1251
1245 } else { 1252 } else {
1246 my $tcp_connect = $arg{tcp_connect} 1253 my $tcp_connect = $arg{tcp_connect}
1247 || do { require AnyEvent::Socket; \&AnyEvent::Socket::tcp_connect }; 1254 || do { require AnyEvent::Socket; \&AnyEvent::Socket::tcp_connect };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines