| 1 | package UserAgent::Any::Response::Impl::HttpResponse; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.036; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | ▶ | use Encode 'decode'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | with 'UserAgent::Any::Response::Impl'; | |||||||||
| 11 | |||||||||||
| 12 | 1 | our $VERSION = 0.01; | |||||||||
| 13 | |||||||||||
| 14 | 1 | ▶ | sub status_code ($self) { | ||||||||
|
Subroutine
status_code: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 15 | 1 | return $self->{res}->code; | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 1 | ▶ | sub status_text ($self) { | ||||||||
|
Subroutine
status_text: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 19 | 1 | return $self->{res}->message; | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 1 | ▶ | sub success ($self) { | ||||||||
|
Subroutine
success: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 23 | 1 | return $self->{res}->is_success; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | has _content => ( | ||||||||||
| 27 | is => 'ro', | ||||||||||
| 28 | lazy => 1, | ||||||||||
| 29 | 2 | ▶ | default => sub ($self) { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 30 | 2 | my $fc = $self->_forced_charset; | |||||||||
| 31 | 2 | ▶ | return decode($fc, $self->raw_content) if defined $fc; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 1 | return $self->{res}->decoded_content; | |||||||||
| 33 | }, | ||||||||||
| 34 | 1 | ); | |||||||||
| 35 | |||||||||||
| 36 | 2 | ▶ | sub content ($self) { | ||||||||
|
Subroutine
content: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 37 | 2 | return $self->_content; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 3 | ▶ | sub raw_content ($self) { | ||||||||
|
Subroutine
raw_content: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 41 | 3 | return $self->{res}->content; | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 0 | ▶ | sub headers ($self) { | ||||||||
|
Subroutine
headers: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 45 | 0 | return $self->{res}->flatten(); | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 5 | ▶ | sub header ($self, $header) { | ||||||||
|
Subroutine
header: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 49 | 5 | return $self->{res}->header($header); | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 1 | 1; | |||||||||
| 53 | |||||||||||
| 54 | __END__ | ||||||||||