apparentlymart / libhttp-request-multi-perl

HTTP::Request::Multi - Perl implementation of Batch HTTP Requests

This URL has Read+Write access

100644 21 lines (15 sloc) 0.523 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!perl -w
 
use strict;
use lib qw(lib);
use HTTP::Request;
use HTTP::Request::Multi;
 
my %sub_requests = get_requests();
my $req = HTTP::Request::Multi->create_request("http://example.com", undef, \%sub_requests);
print $req->as_string;
 
 
sub get_requests {
    return (
        1 => HTTP::Request->new(GET => "http://example.com/1.html"),
        2 => HTTP::Request->new(GET => "http://example.com/2.html"),
# 3 => HTTP::Request->new(POST => "http://example.com/upload.cgi", undef, "Testing"),
    );
 
}