Tornex.HTTP.Client behaviour (Tornex v0.3.0)
View SourceThe behaviours of HTTP client implementations for Tornex.API.get/1
.
Unless otherwise configured with config :tornex, client: AlternateClient
, the default HTTP client is
Tornex.HTTP.FinchClient
.
The child_spec/1
callback is optional and should be configured for HTTP libraries that require a
supervision tree.
Summary
Types
Body of the HTTP response.
HTTP headers for the HTTP request or response.
HTTP status code of the HTTP request.
Callbacks
Optionally get a child spec to start the HTTP client.
Perform an HTTP GET to the specified URL with the headers.
Get the name of the library and its version.
Types
@type body() :: binary()
Body of the HTTP response.
HTTP headers for the HTTP request or response.
@type status() :: 100..599
HTTP status code of the HTTP request.
Callbacks
@callback child_spec(opts :: Keyword.t()) :: Supervisor.child_spec()
Optionally get a child spec to start the HTTP client.
Perform an HTTP GET to the specified URL with the headers.
@callback version() :: String.t()
Get the name of the library and its version.