:ClickSend;
use strict;
use 5.008_005;
our $VERSION = '0.02';
use Carp;
use LWP::UserAgent;
use JSON;
use MIME::Base64;
use HTTP::Request;
use vars qw/$errstr/;
sub errstr { $errstr }
sub new {
($self, $url, $method, $params) = @_;
$url = 'https://api.clicksend.com/rest/v2/' . $url . '.json';
$params ||= {};
$params->{method} = 'rest'; # we prefer rest
my $uri = URI->new($
st($req);
if (not $res->header('Content-Type') =~ /json/) {
$errstr = $res->status_line;
return;
}
return decode_json($res->decoded_content);
}
1;
__END__
=encoding utf-