pec was first released with perl 5.00405
use HTTP::Request::Common qw( GET PUT POST DELETE );
use JSON;
use Log::Any::Adapter;
use LWP::UserAgent;
use LWP::Protocol::https;
#print "LWP::UserAgent: ".L
GET => \&GET,
PUT => \&PUT,
POST => \&POST,
DELETE => \&DELETE,
);
my %sh;
our $JSON = JSON->new->allow_nonref->convert_blessed->utf8->pretty;
=head1 FUNCTIONS
=head2 init_cli_cli
>cookie_jar };
=head2 send_req
Send a request to the server, get the response, convert it from JSON, and
return it to caller. Die on unexpected errors.
=cut
sub send_req {
no strict 'refs';
tml = shift @tokens;
my $json = join( ' ', @tokens );
if ( $json ) {
$json = '"' . $json . '"' unless $json =~ m/^".*"$/;
if ( $
die send_req( $method, 'docu/pod', $json );
} elsif ( $pod_html =~ m/^htm/i ) {
die send_req( $method, 'docu/html', $json );
} elsif ( $
pod_html =~ m/^tex/i ) {
die send_req( $method, 'docu/text', $json );
}
} else {
print "You should specify a resource\n