Class: Client

Client

new Client()

Client resource
Source:

Methods

(static) Client(token, optionsopt)

Create a new Client instance.
Parameters:
Name Type Attributes Description
token string The DigitalOcean token used for authorization.
options ClientOptions <optional>
An object whose values are used to configure a client instance.
Source:

delete(path, content, options, successStatuses, successRootKeys, callbackopt)

Send a HTTP DELETE request with the specified parameters.
Parameters:
Name Type Attributes Description
path string the URL escaped route
content object an object serialized to json
options object an object passed to the request library See the request docs for valid attributes, e.g. a proxy or user agent
successStatuses number | Array.<number> number or array of numbers corresponding to successful HTTP status codes
successRootKeys string | Array.<string> string or array of strings corresponding to the root objects containing successful responses
callback requestCallback <optional>
callback that handles the response
Source:

get(path, options, page or queryObjectopt, perPageopt, successStatuses, successRootKeys, callbackopt)

Send a HTTP GET request with the specified parameters.
Parameters:
Name Type Attributes Description
path string the URL escaped route
options object an object passed to the request library See the request docs for valid attributes, e.g. a proxy or user agent
page or queryObject number | object <optional>
page number to retrieve or key value pairs of query parameters
perPage number <optional>
number of result per page to retrieve
successStatuses number | Array.<number> number or array of numbers corresponding to successful HTTP status codes
successRootKeys string | Array.<string> string or array of strings corresponding to the root objects containing successful responses
callback requestCallback <optional>
callback that handles the response
Source:

patch(path, content, options, successStatuses, successRootKeys, callbackopt)

Send a HTTP PATCH request with the specified parameters.
Parameters:
Name Type Attributes Description
path string the URL escaped route
content object an object serialized to json
options object an object passed to the request library See the request docs for valid attributes, e.g. a proxy or user agent
successStatuses number | Array.<number> number or array of numbers corresponding to successful HTTP status codes
successRootKeys string | Array.<string> string or array of strings corresponding to the root objects containing successful responses
callback requestCallback <optional>
callback that handles the response
Source:

post(path, content, options, successStatuses, successRootKeys, callbackopt)

Send a HTTP POST request with the specified parameters.
Parameters:
Name Type Attributes Description
path string the URL escaped route
content object an object serialized to json
options object an object passed to the request library See the request docs for valid attributes, e.g. a proxy or user agent
successStatuses number | Array.<number> number or array of numbers corresponding to successful HTTP status codes
successRootKeys string | Array.<string> string or array of strings corresponding to the root objects containing successful responses
callback requestCallback <optional>
callback that handles the response
Source:

put(path, content, options, successStatuses, successRootKeys, callbackopt)

Send a HTTP PUT request with the specified parameters.
Parameters:
Name Type Attributes Description
path string the URL escaped route
content object an object serialized to json
options object an object passed to the request library See the request docs for valid attributes, e.g. a proxy or user agent
successStatuses number | Array.<number> number or array of numbers corresponding to successful HTTP status codes
successRootKeys string | Array.<string> string or array of strings corresponding to the root objects containing successful responses
callback requestCallback <optional>
callback that handles the response
Source: