;
use Carp qw{ carp croak };
use List::Util 'first';
use LWP::UserAgent ();
use JSON ();
use Digest::SHA 'sha1_hex';
# # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # #
# Class variables
my $UserAgent = LWP::UserAgent->new(timeout => 10);
my $Json = JSON->new->allow_nonref;
my @accessRuleMethods = qw{ GET POST PUT DELETE };
my %configKey = (
e 'get' and $method ne 'delete')
{
$body = $Json->encode($params{'body'});
$httpHeaders{'Content-type'} = 'application/json';
$content{'Content'} = $body;
}
unles
qw{ carp croak };
use JSON ();
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Class variables
my $Json = JSON->new->allow_nonref;
# End -
{
return $content->{'message'};
}
else
{
return 'JSON decoding error';
}
}
else
{
return '';
}
}
sub toString
{
my
{'response'}->content };
}
eval { $content = $Json->decode($self->{'response'}->content); 1; } or do {
carp 'Failed to parse JSON content from the answer: ', $self->{'response'}->cont