View Source BtrzExApiClient (btrz_ex_api_client v0.10.0)
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-keyheader.:internal- Optional. Boolean. Iftrueit will use the main/secondary keys (passed via config) for getting an internal JWT to be set in theAuthorizationheader. Defaults tofalse.:token- Optional. Set the JWT in theAuthorizationheader. If:internaloption istrue, this option will be discarded.
options
Using the HTTPoison options (https://hexdocs.pm/httpoison/HTTPoison.Request.html)