e strict;
use warnings;
# use other modules
use IO::Socket::SSL;
use REST::Client;
use Carp;
use JSON::MaybeXS;
use URI; # The GET requests need URI-escaping
our $VERSION = '0.04';
sub new {
my
/api/v$self->{api_ver}/$path";
my $ct = {'Content-type' => 'application/json'};
my $headers = {
Accept => 'application/json',
Key => $self->{key}
};
if ($meth eq 'GET') {
my $u = URI->new
ion/json';
$self->{ua}->POST ($path, encode_json ($data), $headers);
} else {
croak "Unrecognised method '$meth'";
}
if ($self->{ua}->responseCode !~ /400|50./) {
return decode_json $s