===================
#
# FILE: rest-client.pl
#
# USAGE: ./rest-client.pl -config <JSON-encoded config string>
#
# DESCRIPTION:
# performs request and display (eventually decoded) r
;
use JSON qw( from_json to_json decode_json );
use Data::Dumper qw( Dumper );
use LWP::ConsoleLogger::Everywhere ();
use RestAPI ();
$Data::Dumper::Indent = 1;
my $config_as_json;
my
$0
-config # a JSON-encoded configuration snippet, or
-config_file # a JSON-encoded file
EOT
}
GetOptions(
"config=s" => \$config_as_json,
"config_file=s" => \$con
Ref Bool Str Int );
use namespace::autoclean;
use XML::Simple qw( XMLin XMLout );
use JSON::XS ();
use LWP::UserAgent ();
use Time::HiRes qw( gettimeofday tv_interval );
# Bas
s');
has 'ua' => ( is => 'rw', writer => '_set_ua' );
has 'jsonObj' => ( is => 'ro', default => sub {
return JSON::XS->new
->utf8
->allow_nonref
$str = XMLout( $self->payload );
}
when ( m|json| ) {
$str = $self->jsonObj->encode( $self->payload );
}
}
$self->payload(