| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package HTTP::Message::JSON; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 4 |  |  | 4 |  | 1636 | use strict; | 
|  | 4 |  |  |  |  | 9 |  | 
|  | 4 |  |  |  |  | 108 |  | 
| 4 | 4 |  |  | 4 |  | 21 | use warnings; | 
|  | 4 |  |  |  |  | 8 |  | 
|  | 4 |  |  |  |  | 108 |  | 
| 5 | 4 |  |  | 4 |  | 22 | no warnings 'uninitialized'; | 
|  | 4 |  |  |  |  | 7 |  | 
|  | 4 |  |  |  |  | 463 |  | 
| 6 |  |  |  |  |  |  |  | 
| 7 |  |  |  |  |  |  | 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 | 90 |  |  | 90 | 1 | 30365 | my ($self) = @_; | 
| 28 |  |  |  |  |  |  |  | 
| 29 | 90 | 100 |  |  |  | 264 | if ($self->content_type eq 'application/json') { | 
| 30 | 85 |  |  |  |  | 2987 | return 1; | 
| 31 |  |  |  |  |  |  | } else { | 
| 32 | 5 |  |  |  |  | 189 | return HTTP::Headers::content_is_text($self); | 
| 33 |  |  |  |  |  |  | } | 
| 34 |  |  |  |  |  |  | } | 
| 35 |  |  |  |  |  |  |  | 
| 36 |  |  |  |  |  |  | 1; |