| 1 | package HTTP::Message::JSON; | ||||||||||
| 2 | |||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 6 | ▶ | no warnings 'uninitialized'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 6 | our $VERSION = $LWP::JSON::Tiny::VERSION; | |||||||||
| 8 | |||||||||||
| 9 | =head1 NAME | ||||||||||
| 10 | |||||||||||
| 11 | HTTP::Message::JSON - a very simple superclass for JSON HTTP messages | ||||||||||
| 12 | |||||||||||
| 13 | =head1 DESCRIPTION | ||||||||||
| 14 | |||||||||||
| 15 | This is a very simple superclass used by HTTP::Request::JSON and | ||||||||||
| 16 | HTTP::Response::JSON. It overrides the default behaviour of the HTTP::Headers | ||||||||||
| 17 | method content_is_text. | ||||||||||
| 18 | |||||||||||
| 19 | =head2 content_is_text | ||||||||||
| 20 | |||||||||||
| 21 | Returns TRUE if this is a message with content type application/json. | ||||||||||
| 22 | Otherwise uses the default behaviour of HTTP::Headers. | ||||||||||
| 23 | |||||||||||
| 24 | =cut | ||||||||||
| 25 | |||||||||||
| 26 | sub content_is_text { | ||||||||||
| 27 | 94 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
content_is_text: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 28 | |||||||||||
| 29 | 94 | ▶ | if ($self->content_type eq 'application/json') { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 89 | return 1; | |||||||||
| 31 | } else { | ||||||||||
| 32 | 5 | return HTTP::Headers::content_is_text($self); | |||||||||
| 33 | } | ||||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 6 | 1; | |||||||||