API-Eulerian
view release on metacpan or search on metacpan
lib/API/Eulerian/EDW/Authority.pm view on Meta::CPAN
# We expect JSON reply data
$json = API::Eulerian::EDW::Request->json( $response );
if( $json && ( $code == 200 ) ) {
$status = $json->{ error } ?
$class->_error( $code, $json->{ error_msg } ) :
$class->_success( $kind, $json );
} else {
$status = $class->_error(
$code, $json ?
encode_json( $json ) :
$response->decoded_content
);
}
}
return $status;
}
#
# @brief Get API::Eulerian::EDW Authority URL used to retrieve Session/Access Token
# to API::Eulerian::EDW Data Warehouse Platform.
#
lib/API/Eulerian/EDW/Request.pm view on Meta::CPAN
# @param $response - HTTP response.
#
# @return JSON object.
#
sub json
{
my ( $class, $response ) = @_;
my $data = undef;
if( $class->is_json( $response ) ) {
$data = $response->decoded_content;
if( defined( $data ) ) {
chomp( $data );
if( length( $data ) > 0 ) {
$data = encode( 'utf-8', $data );
$data = decode_json( $data );
} else {
$data = undef;
}
}
}
( run in 0.297 second using v1.01-cache-2.11-cpan-26ccb49234f )