0;
use utf8;
use strict;
use warnings;
use Carp;
use URI;
use MIME::Base64;
use URI::Escape;
use JSON 2.23;
use Data::Util qw/:check/;
use REST::Client;
sub new {
my ($class, $URL, $username, $p
er(Accept => 'application/json');
# Configure UserAgent name
$rest->getUseragent->agent(__PACKAGE__);
return bless {
rest => $rest,
json => JSON->new->utf8->allow_nonref,
m:text/plain:i) {
$msg .= $content;
} elsif ($type =~ m:application/json:) {
my $error = $self->{json}->decode($content);
if (ref $error eq 'HASH' && exists $error->{errorM