h my %OUTPUT => (
'json' => q{application/json},
'xml' => q{text/xml},
'php' => q{text/plain},
);
Readonly::Hash my %RESPONSE => (
'version' => {
'json' => q{{
"version":
2:{s:7:"version";s:2:"v1";s:5:"build";s:5:"0.0.1";}}}},
},
'latest_article' => {
'json' => q{{
"latest_article": [
[
{
"id": "156833"
"type": "artic
]></keyword>
</keywords>
</article>
</list>},
},
'latest_video' => {
'json' => q{{
"latest_video": [
[
{
"id": "175327"
s
qw(HTTP_OK HTTP_BAD_REQUEST HTTP_UNAUTHORIZED HTTP_FORBIDDEN HTTP_INTERNAL_SERVER_ERROR);
use JSON;
use LWP::UserAgent;
use Log::Log4perl qw(:easy get_logger);
use Moose qw/around has with/;
use M
ERR{'INTERNAL_SERVER'},
);
}
elsif ( $response->code > HTTP_OK ) {
my $json = JSON->new;
if ( $response->code == HTTP_BAD_REQUEST ) {
## no critic qw(Requir
NOSOpenBadRequestException->throw(
## use critic
'error' => $json->decode( $response->decoded_content ),
);
}
elsif ( $response->code =