View Source BtrzExApiClient (btrz_ex_api_client v0.9.3)
Main module to handle requests to the Betterez's APIs.
Summary
Functions
This function will prepare and do the request through the HTTP client and will handle success and errors responses.
Functions
@spec request( BtrzExApiClient.Types.methods(), String.t(), iolist(), map(), keyword(), keyword() ) :: {:error, %BtrzExApiClient.APIConnectionError{ __exception__: term(), code: term(), message: term(), type: term() } | %BtrzExApiClient.APIError{ __exception__: term(), code: term(), message: term(), status: term(), type: term() } | %BtrzExApiClient.AuthenticationError{ __exception__: term(), code: term(), message: term(), status: term(), type: term() } | %BtrzExApiClient.InvalidRequestError{ __exception__: term(), code: term(), message: term(), status: term(), type: term() }} | {:ok, term()}
This function will prepare and do the request through the HTTP client and will handle success and errors responses.
headers
:x_api_key
- Optional. This value will be placed in thex-api-key
header.:internal
- Optional. Boolean. Iftrue
it will use the main/secondary keys (passed via config) for getting an internal JWT to be set in theAuthorization
header. Defaults tofalse
.:token
- Optional. Set the JWT in theAuthorization
header. If:internal
option istrue
, this option will be discarded.
options
Using the HTTPoison options (https://hexdocs.pm/httpoison/HTTPoison.Request.html)