InfluxEx.HTTP behaviour (influx_ex v0.3.1)
Behaviour for HTTP clients
By default InfluxEx
will try to use the Mojito
library to make HTTP
requests, however, if you prefer or use another HTTP library you can
implement this behaviour for your HTTP library to integer with InfluxEx
Link to this section Summary
Callbacks
Send a request
Link to this section Types
Link to this type
status_code()
@type status_code() :: 100..599
@type t() :: module()
A module that implements the HTTP behaviour
Link to this section Callbacks
Link to this callback
send_request( method, url, headers, arg4 )
@callback send_request( InfluxEx.HTTP.Request.method(), InfluxEx.HTTP.Request.url(), InfluxEx.HTTP.Request.headers(), InfluxEx.HTTP.Request.payload() | nil ) :: {:ok, InfluxEx.HTTP.Response.t()} | {:error, term()}
Send a request
InfluxEx
tries to all the heavy lifting for you, so you only have to worry
about sending the request.
For building the response you only need to pass through the status code and
the body. You don't need to worry about parsing the body as InfluxEx
can
handle that in a generic way.