SMS service
use Carp;
use HTTP::Tiny;
use URI::Escape qw( uri_escape );
use JSON::MaybeXS qw( decode_json encode_json JSON );
use base 'SMS::Send::Driver';
sub new {
my $class = shift;
my
# to ensure the response is JSON and not the XML default
'accept' => 'application/json; charset=utf-8',
'content-type' => 'application/json; charset=utf-8',
},
nt => encode_json(\%message),
}
);
# for example a timeout error
die $response->{content}
unless $response->{success};
my $response_message = decode_json( $response->