line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::Body::Builder::UrlEncoded; |
2
|
1
|
|
|
1
|
|
23633
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
45
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
6
|
use utf8; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
5
|
1
|
|
|
1
|
|
52
|
use 5.008_005; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
54
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use Carp (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
16
|
|
8
|
1
|
|
|
1
|
|
1050
|
use URI; |
|
1
|
|
|
|
|
7721
|
|
|
1
|
|
|
|
|
287
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
3
|
|
|
3
|
1
|
2928
|
my $class = shift; |
12
|
3
|
50
|
|
|
|
11
|
my %args = @_==1 ? %{$_[0]} : @_; |
|
0
|
|
|
|
|
0
|
|
13
|
3
|
|
|
|
|
12
|
bless { |
14
|
|
|
|
|
|
|
%args |
15
|
|
|
|
|
|
|
}, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub add_content { |
19
|
2
|
|
|
2
|
1
|
10
|
my ($self, $name, $value) = @_; |
20
|
2
|
|
|
|
|
5
|
push @{$self->{content}}, [$name, $value]; |
|
2
|
|
|
|
|
11
|
|
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub content_type { |
24
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
25
|
0
|
|
|
|
|
0
|
return 'application/x-www-form-urlencoded'; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub add_file { |
29
|
1
|
|
|
1
|
0
|
181
|
Carp::croak "You cannot add file with application/x-www-form-urlencoded."; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub as_string { |
33
|
2
|
|
|
2
|
1
|
11
|
my ($self) = @_; |
34
|
|
|
|
|
|
|
|
35
|
2
|
|
|
|
|
11
|
my $uri = URI->new('http:'); |
36
|
2
|
|
|
|
|
9105
|
$uri->query_form(@{$self->{content}}); |
|
2
|
|
|
|
|
15
|
|
37
|
2
|
|
|
|
|
268
|
my $content = $uri->query; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# HTML/4.01 says that line breaks are represented as "CR LF" pairs (i.e., `%0D%0A') |
40
|
2
|
50
|
|
|
|
21
|
$content =~ s/(?
|
41
|
2
|
|
|
|
|
20
|
$content; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
__END__ |