| 1 | package UserAgent::Any::Response::Impl; | ||||||||||
| 2 | |||||||||||
| 3 | 11 | ▶ | use 5.036; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 11 | ▶ | use Moo::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 11 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 11 | our $VERSION = 0.01; | |||||||||
| 10 | |||||||||||
| 11 | 11 | has res => ( | |||||||||
| 12 | is => 'ro', | ||||||||||
| 13 | required => 1, | ||||||||||
| 14 | ); | ||||||||||
| 15 | |||||||||||
| 16 | # This is used to compensate for some response implementation that don’t decode | ||||||||||
| 17 | # JSON content (as it’s not in the spec). | ||||||||||
| 18 | has _forced_charset => ( | ||||||||||
| 19 | is => 'ro', | ||||||||||
| 20 | lazy => 1, | ||||||||||
| 21 | 2 | ▶ | default => sub ($self) { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 22 | 2 | ▶ | if ($self->header('Content-Type') =~ m{^ application/json \s* ; .* \s* charset=([^ ;]+) }xi) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | { | ||||||||||
| 24 | 1 | return $1; | |||||||||
| 25 | } else { | ||||||||||
| 26 | 1 | return; | |||||||||
| 27 | } | ||||||||||
| 28 | }, | ||||||||||
| 29 | 11 | ); | |||||||||
| 30 | |||||||||||
| 31 | 11 | requires qw(status_code status_text success content raw_content headers header); | |||||||||
| 32 | |||||||||||
| 33 | 11 | 1; | |||||||||