webservice
use Carp;
use HTTP::Tiny;
use URI::Escape qw( uri_escape );
use JSON::MaybeXS qw( decode_json encode_json JSON );
use Try::Tiny;
use Exception::Class (
'SMS::Send::Retarus::Exception'
> {
# to ensure the response is JSON
'accept' => 'application/json; charset=utf-8',
'content-type' => 'application/json; charset=utf-8',
},
timeout
content => encode_json(\%message),
}
);
if ( $response->{success} ) {
my $content;
try {
$content = decode_json( $response->{content} );