OpenStack::Client;
use strict;
use warnings;
use HTTP::Request ();
use LWP::UserAgent ();
use JSON ();
use URI::Encode ();
use OpenStack::Client::Response ();
our $VERSION = '1.0007';
=e
$request->content($args{'body'});
} else {
$request->content(JSON::encode_json($args{'body'}));
}
}
return bless $self->{'ua'}->request($request,
Defaults to C<application/json, text/plain>.
=item Accept-Encoding
Defaults to C<identity, gzip, deflate, compress>.
=item Content-Type
Defaults to C<application/json>, although some API calls (
path' => '/auth/tokens',
'body' => \%request
);
my $body = $response->decode_json;
unless (defined $response->header('X-Subject-Token')) {
die 'No token found in resp
e OpenStack::Client::Response;
use strict;
use warnings;
use base 'HTTP::Response';
sub decode_json {
my ($self) = @_;
my $type = $self->header('Content-Type');
my $content = $self-
t;
}
if (defined $content && length $content) {
if (lc($type) =~ qr{^application/json}i) {
return JSON::decode_json($content);
}
}
return $content;
}
1;
method will return an object containing the following:
=over
=item * response
The full decoded JSON authorization response from Keystone
=item * services
A hash containing services the client has