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.3 by root, Wed Jun 4 11:58:36 2008 UTC vs.
Revision 1.4 by root, Wed Jun 4 11:59:22 2008 UTC

241 } 241 }
242 242
243 substr $_, 0, 1, "" 243 substr $_, 0, 1, ""
244 for values %hdr; 244 for values %hdr;
245 245
246 if ($method ne "HEAD") { 246 if ($method eq "HEAD") {
247 %state = ();
248 $cb->(undef, \%hdr);
249 } else {
247 if (exists $hdr{"content-length"}) { 250 if (exists $hdr{"content-length"}) {
248 $_[0]->unshift_read (chunk => $hdr{"content-length"}, sub { 251 $_[0]->unshift_read (chunk => $hdr{"content-length"}, sub {
249 # could cache persistent connection now 252 # could cache persistent connection now
250 if ($hdr{connection} =~ /\bkeep-alive\b/i) { 253 if ($hdr{connection} =~ /\bkeep-alive\b/i) {
251 # but we don't, due to misdesigns, this is annoyingly complex 254 # but we don't, due to misdesigns, this is annoyingly complex
277sub http_get($$;@) { 280sub http_get($$;@) {
278 unshift @_, "GET"; 281 unshift @_, "GET";
279 &http_request 282 &http_request
280} 283}
281 284
285sub http_head($$;@) {
286 unshift @_, "HEAD";
287 &http_request
288}
289
282sub http_post($$$;@) { 290sub http_post($$$;@) {
283 unshift @_, "POST", "body"; 291 unshift @_, "POST", "body";
284 &http_request 292 &http_request
285} 293}
286 294

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines