View Source Consul.Response (consulex v0.2.1)
This module helps decode Tesla responses
Link to this section Summary
Functions
Handle the response for a Tesla request
Link to this section Functions
Specs
decode({:ok, Tesla.Env.t()}, keyword()) :: {:ok, struct()} | {:error, Tesla.Env.t()}
Handle the response for a Tesla request
parameters
Parameters
response
(type:{:ok, Tesla.Env.t} | {:error, reason}
) - The response objectopts
(type:keyword()
) - [optional] Optional parameters:as
(type:module()
) - If present, decode as struct or list.
returns
Returns
{:ok, struct()}
on success{:error, Tesla.Env.t}
on failure