ing for NIOS
# VERSION
# AUTHORITY
## use critic
use strictures 2;
use Carp qw(croak);
use JSON qw(to_json);
use LWP::UserAgent;
use MIME::Base64 qw(encode_base64);
use URI;
use URI::QueryParam;
use
$self->{ua}->default_header( 'Accept' => 'application/json' );
$self->{ua}->default_header( 'Content-Type' => 'application/json' );
$self->{ua}->default_header( 'Authorization' => 'Basic
l} . $path . $query_params );
if ( $op eq 'PUT' or $op eq 'POST' ) {
$request->content( to_json($payload) );
}
return DNS::NIOS::Response->new(
_http_response => $self->{ua}->request($
e object
# VERSION
# AUTHORITY
## use critic
use strictures 2;
use Carp qw(croak);
use JSON qw(from_json to_json);
use Try::Tiny;
use namespace::clean;
use Class::Tiny qw( _http_response );
sub BUIL
->_http_response->is_success;
}
sub content {
my $self = shift;
my $h;
try {
$h = from_json( $self->_http_response->decoded_content );
}
catch {
$h = $self->_http_response->decoded
sub json {
my $self = shift;
try {
my $h = to_json( $self->content, @_ );
return $h;
};
return to_json( { content => $self->content }, @_ );
}
sub pretty {
return shift->json( { u