ExKeyCDN.HTTP (exkeycdn v0.0.1)
Base client for all server interaction, used by all endpoint specific modules.
This request wrapper coordinates the remote server, headers, authorization and SSL options.
Using ExKeyCDN.HTTP
requires the presence of one config value:
api_key
- ExKeyCDN api key
Value must be set or a ExKeyCDN.ConfigError
will be raised at
runtime. All those config values support the {:system, "VAR_NAME"}
as a
value - in which case the value will be read from the system environment with
System.get_env("VAR_NAME")
.
Link to this section Summary
Functions
Centralized request handling function. All convenience structs use this function to interact with the ExKeyCDN servers. This function can be used directly to supplement missing functionality.
Link to this section Types
response()
Specs
response() :: {:ok, map(), list() | {:error, atom()}} | {:error, ExKeyCDN.ErrorResponse.t()} | {:error, binary()}
Link to this section Functions
delete(path)
Specs
delete(path, payload)
Specs
get(path)
Specs
get(path, payload)
Specs
get_lazy_env(opts, key, default \\ nil)
post(path)
Specs
post(path, payload)
Specs
put(path)
Specs
put(path, payload)
Specs
request(method, path, body \\ %{})
Specs
Centralized request handling function. All convenience structs use this function to interact with the ExKeyCDN servers. This function can be used directly to supplement missing functionality.
Example
defmodule MyApp.ExKeyCDN do
alias ExKeyCDN.HTTP
def zones(params \ %{}) do
HTTP.request(:get, "zones.json", params)
end
end