| 1 | 2 | ▶ | use v5.20.0; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | package JMAP::Tester::Role::HTTPResult 0.113; | ||||||||||
| 4 | # ABSTRACT: the kind of thing that you get back for an http request | ||||||||||
| 5 | |||||||||||
| 6 | 2 | ▶ | use Moo::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 2 | with 'JMAP::Tester::Role::Result'; | |||||||||
| 9 | |||||||||||
| 10 | 2 | ▶ | use experimental 'signatures'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | #pod =head1 OVERVIEW | ||||||||||
| 13 | #pod | ||||||||||
| 14 | #pod This is the role consumed by the class of any object returned by | ||||||||||
| 15 | #pod L<JMAP::Tester>'s C<request> method. In addition to | ||||||||||
| 16 | #pod L<JMAP::Tester::Role::Result>, this role provides C<http_response> to | ||||||||||
| 17 | #pod get at the underlying L<HTTP::Response> object. C<response_payload> will | ||||||||||
| 18 | #pod come from the C<as_string> method of that object. | ||||||||||
| 19 | #pod | ||||||||||
| 20 | #pod =cut | ||||||||||
| 21 | |||||||||||
| 22 | 2 | has http_response => ( | |||||||||
| 23 | is => 'ro', | ||||||||||
| 24 | ); | ||||||||||
| 25 | |||||||||||
| 26 | #pod =method response_payload | ||||||||||
| 27 | #pod | ||||||||||
| 28 | #pod Returns the raw payload of the response, if there is one. Empty string | ||||||||||
| 29 | #pod otherwise. Mostly this will be C<< $self->http_response->as_string >> | ||||||||||
| 30 | #pod but other result types may exist that don't have an http_response... | ||||||||||
| 31 | #pod | ||||||||||
| 32 | #pod =cut | ||||||||||
| 33 | |||||||||||
| 34 | 4 | ▶ | sub response_payload ($self) { | ||||||||
|
Subroutine
response_payload: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 35 | 4 | ▶ | return $self->http_response ? $self->http_response->as_string : ''; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 2 | 1; | |||||||||
| 39 | |||||||||||
| 40 | __END__ | ||||||||||