se warnings;
use 5.010_001;
use Carp;
use LWP::UserAgent;
use HTTP::Request;
use URI::Escape;
use JSON;
use Encode qw( encode_utf8 );
use Scalar::Util 'looks_like_number';
use version 0.77; our $VERSI
},
) : (),
);
$self->{ua}->default_header( 'Accept' => 'application/json' );
$self->{login_status} = "not logged in";
return $self;
}
sub do_request {
my (
my $req = HTTP::Request->new( $method => $request_url );
if ($data) {
$data = encode_json($data);
$req->content($data);
}
$self->{res} = $self->{ua}->request($req);
e Icinga API supports.
"DATA" is optional and is a Perl data structure that will be converted to JSON.
Returns the result in a perl reference.
=item export (FULL, API_ONLY)
Returns a Perl Data str
ibutes will be included in
the export. Objects exported with FULL set to true can be converted to json and be
used for PUT requests, but not necessarily for POST requests.
"API_ONLY" is optional and
HTTP status line.
=back
=head1 DEPENDS
L<LWP::UserAgent>,
L<HTTP::Request>,
L<URI::Escape>,
L<JSON>,
L<Encode>
=head1 LICENSE
Copyright (c) 2016-, IT Services, Stockholm University
All rights r