::Response;
BEGIN {
$PowerDNS::API::Client::Response::VERSION = '0.10';
}
use Moose;
use JSON qw(decode_json);
use namespace::clean -except => 'meta';
has http => (
is => 'ro',
isa
1,
);
sub _build_data {
my $self = shift;
if ($self->http->content_type ne 'application/json') {
if ($ENV{API_DEBUG}) {
require Data::Dumper;
warn "PowerDNS::
code,
error => $self->http->status_line,
};
}
my $data = decode_json($self->http->decoded_content);
$data->{http_status} = $self->http->code;
if ($ENV{API_DEB