View Source Docspring.Connection (docspring v1.0.0)
Handle Tesla connections for Docspring.
Additional middleware can be set in the compile-time or runtime configuration:
config :tesla, Docspring.Connection,
base_url: "https://api.docspring.com/api/v1",
adapter: Tesla.Adapter.Hackney
The default base URL can also be set as:
config :docspring,
:base_url, "https://api.docspring.com/api/v1"
Summary
Functions
Returns the default adapter for this API.
Returns fully configured middleware for passing to Tesla.client/2.
Configure a client with no authentication.
Configure a client that may have authentication.
Configure a client using username and password for basic authentication.
Forward requests to Tesla.
Types
@type options() :: [ base_url: String.t(), user_agent: String.t(), username: String.t() | nil, password: String.t() | nil ]
The list of options that can be passed to new/1.
base_url
: Overrides the base URL on a per-client basis.user_agent
: Overrides the User-Agent header.username
: A username for basic authentication.password
: A password for basic authentication.
Functions
Returns the default adapter for this API.
@spec middleware(options()) :: [Tesla.Client.middleware()]
Returns fully configured middleware for passing to Tesla.client/2.
@spec new() :: Tesla.Env.client()
Configure a client with no authentication.
Returns
Tesla.Env.client
@spec new(options()) :: Tesla.Env.client()
Configure a client that may have authentication.
Parameters
options
: a keyword list of OpenAPIPetstore.Connection.options.
Returns
Tesla.Env.client
@spec new(String.t(), String.t(), options()) :: Tesla.Env.client()
Configure a client using username and password for basic authentication.
Parameters
username
: a String representing a username.password
: a String representing a password.options
: a keyword list of Docspring.Connection.options.
Returns
Tesla.Env.client
@spec request(Tesla.Client.t(), [Tesla.option()]) :: Tesla.Env.result()
Forward requests to Tesla.