NAME

WebService::DigitalOcean::Role::UserAgent - User Agent Role for DigitalOcean WebService

VERSION

version 0.020

DESCRIPTION

Role used to make requests to the DigitalOcean API, and to format their response.

METHODS

$res = $do->make_request($method, $path[, $data)

Arguments

Str $method

The HTTP verb, such as POST, GET, PUT, etc.

Str $path

Path to the resource in the URI, to be prepended with $self->api_base_url.

HashRef $data (optional)

The content to be JSON encoded and sent to DigitalOcean's API.

Returns

HashRef containing:

HTTP::Response response_object
Bool is_success

Shortcut to $res->{response_object}{is_success}.

Str status_line

Shortcut to $res->{response_object}{status_line}.

HashRef content

The JSON decoded content the API has responded with.

HashRef ratelimit

RateLimit headers parsed.

Int limit
Int remaining
DateTime reset

Makes requests to the DigitalOcean, and parses the response.

All requests made from other methods use "make_request" to make them.

my $res = $self->make_request(POST => '/domains', {
    name       => 'example.com',
    ip_address => '12.34.56.78',
});

Note: this is how "domain_create" in WebService::DigitalOcean::Role::Domains is implemented. You shouldn't use this method directly in your application whenever possible. It's kept as a public method only because the API isn't entirely implemented in the module yet.

More info: https://developers.digitalocean.com/#introduction.

AUTHOR

André Walker <andre@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2014 by André Walker.

This is free software, licensed under:

The GNU General Public License, Version 2, June 1991