dnsimple v1.2.0 Dnsimple.Client

Summary

Functions

Issues a DELETE request to the given url

Returns the representation of an empty body in a request

Issues a GET request to the given url

Issues a PATCH request to the given url

Issues a POST request to the given url

Issues a PUT request to the given url

Prepends the correct API version to path

Types

body ::
  binary |
  {:form, [{atom, any}]} |
  {:file, binary}
headers ::
  [{binary, binary}] |
  %{optional(binary) => binary}
t :: %Dnsimple.Client{access_token: String.t, base_url: String.t, user_agent: String.t}

Functions

delete(client, url, options \\ [])

Specs

delete(Dnsimple.Client.t, binary, Keyword.t) :: {:ok | :error, HTTPoison.Response.t | HTTPoison.AsyncResponse.t}

Issues a DELETE request to the given url.

empty_body()

Specs

empty_body :: nil

Returns the representation of an empty body in a request.

Examples

iex> Dnsimple.Client.empty_body() nil

execute(client, method, url, body \\ "", all_options \\ [])
get(client, url, options \\ [])

Specs

get(Dnsimple.Client.t, binary, Keyword.t) :: {:ok | :error, HTTPoison.Response.t | HTTPoison.AsyncResponse.t}

Issues a GET request to the given url.

patch(client, url, body, options \\ [])

Specs

patch(Dnsimple.Client.t, binary, body, Keyword.t) :: {:ok | :error, HTTPoison.Response.t | HTTPoison.AsyncResponse.t}

Issues a PATCH request to the given url.

post(client, url, body, options \\ [])

Specs

post(Dnsimple.Client.t, binary, body, Keyword.t) :: {:ok | :error, HTTPoison.Response.t | HTTPoison.AsyncResponse.t}

Issues a POST request to the given url.

put(client, url, body, options \\ [])

Specs

put(Dnsimple.Client.t, binary, body, Keyword.t) :: {:ok | :error, HTTPoison.Response.t | HTTPoison.AsyncResponse.t}

Issues a PUT request to the given url.

versioned(path)

Specs

versioned(String.t) :: String.t

Prepends the correct API version to path.

Examples

iex> Dnsimple.Client.versioned "/whoami"
"/v2/whoami"