line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Azure::EventHubs::Response; |
2
|
7
|
|
|
7
|
|
51
|
use strict; |
|
7
|
|
|
|
|
18
|
|
|
7
|
|
|
|
|
210
|
|
3
|
7
|
|
|
7
|
|
36
|
use warnings; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
194
|
|
4
|
|
|
|
|
|
|
|
5
|
7
|
|
|
7
|
|
41
|
use parent 'HTTP::Response'; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
37
|
|
6
|
7
|
|
|
7
|
|
55623
|
use JSON; |
|
7
|
|
|
|
|
68532
|
|
|
7
|
|
|
|
|
41
|
|
7
|
7
|
|
|
7
|
|
1002
|
use Carp; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
1103
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub as_hashref { |
10
|
2
|
|
|
2
|
1
|
1557
|
my $self = shift; |
11
|
2
|
50
|
|
|
|
15
|
return if !$self->is_success; |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
|
|
36
|
my $type = $self->header('Content-Type'); |
14
|
2
|
100
|
66
|
|
|
140
|
if ($type && $type =~ /\Aapplication\/json/) { |
15
|
1
|
|
|
|
|
63
|
return JSON->new->utf8(1)->decode($self->content); |
16
|
|
|
|
|
|
|
} |
17
|
1
|
|
|
|
|
3
|
return; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
1; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=encoding utf-8 |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 NAME |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Net::Azure::EventHubs::Response - A Response Class for Net::Azure::EventHubs |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 SYNOPSIS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
use Net::Azure::EventHubs::Request; |
31
|
|
|
|
|
|
|
use LWP::UserAgent; |
32
|
|
|
|
|
|
|
my $req = Net::Azure::EventHubs::Request->new(GET => 'http://...'); |
33
|
|
|
|
|
|
|
$req->agent(LWP::UserAgent->new); |
34
|
|
|
|
|
|
|
my $res = $req->do; |
35
|
|
|
|
|
|
|
my $json_data = $res->as_hashref; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 DESCRIPTION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Net::Azure::EventHubs::Response is a response class for Net::Azure::EventHubs. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
It inherits HTTP::Response. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 METHODS |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 as_hashref |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
my $json_data = $res->as_hashref; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Return a content data as hashref when content type is 'application/json'. Otherwise, undef is returned. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 LICENSE |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Copyright (C) ytnobody. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
56
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 AUTHOR |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
ytnobody Eytnobody@gmail.comE |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |
63
|
|
|
|
|
|
|
|