| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Plack::LWPish; |
|
2
|
50
|
|
|
50
|
|
304
|
use strict; |
|
|
50
|
|
|
|
|
98
|
|
|
|
50
|
|
|
|
|
1275
|
|
|
3
|
50
|
|
|
50
|
|
203
|
use warnings; |
|
|
50
|
|
|
|
|
62
|
|
|
|
50
|
|
|
|
|
1008
|
|
|
4
|
50
|
|
|
50
|
|
30395
|
use HTTP::Tiny; |
|
|
50
|
|
|
|
|
521748
|
|
|
|
50
|
|
|
|
|
1553
|
|
|
5
|
50
|
|
|
50
|
|
16386
|
use HTTP::Response; |
|
|
50
|
|
|
|
|
228426
|
|
|
|
50
|
|
|
|
|
1365
|
|
|
6
|
50
|
|
|
50
|
|
4307
|
use Hash::MultiValue; |
|
|
50
|
|
|
|
|
17071
|
|
|
|
50
|
|
|
|
|
10263
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
|
9
|
17
|
|
|
17
|
0
|
87
|
my $class = shift; |
|
10
|
17
|
|
|
|
|
105
|
my $self = bless {}, $class; |
|
11
|
17
|
50
|
|
|
|
568
|
$self->{http} = @_ == 1 ? $_[0] : HTTP::Tiny->new(verify_SSL => 1, @_); |
|
12
|
17
|
|
|
|
|
2968
|
$self; |
|
13
|
|
|
|
|
|
|
} |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub request { |
|
16
|
89
|
|
|
89
|
0
|
352
|
my($self, $req) = @_; |
|
17
|
|
|
|
|
|
|
|
|
18
|
89
|
|
|
|
|
167
|
my @headers; |
|
19
|
89
|
|
|
107
|
|
410
|
$req->headers->scan(sub { push @headers, @_ }); |
|
|
107
|
|
|
|
|
3039
|
|
|
20
|
|
|
|
|
|
|
|
|
21
|
89
|
|
|
|
|
1610
|
my $options = { |
|
22
|
|
|
|
|
|
|
headers => Hash::MultiValue->new(@headers)->mixed, |
|
23
|
|
|
|
|
|
|
}; |
|
24
|
89
|
100
|
66
|
|
|
6255
|
$options->{content} = $req->content if defined $req->content && length($req->content); |
|
25
|
|
|
|
|
|
|
|
|
26
|
89
|
|
|
|
|
3228
|
my $response = $self->{http}->request($req->method, $req->url, $options); |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $res = HTTP::Response->new( |
|
29
|
|
|
|
|
|
|
$response->{status}, |
|
30
|
|
|
|
|
|
|
$response->{reason}, |
|
31
|
|
|
|
|
|
|
[ Hash::MultiValue->from_mixed($response->{headers})->flatten ], |
|
32
|
|
|
|
|
|
|
$response->{content}, |
|
33
|
89
|
|
|
|
|
34230689
|
); |
|
34
|
89
|
|
|
|
|
27656
|
$res->request($req); |
|
35
|
|
|
|
|
|
|
|
|
36
|
89
|
|
|
|
|
2874
|
return $res; |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |