View Source Docspring.RequestBuilder (docspring v0.0.4)
Helper functions for building Tesla requests
Link to this section Summary
Functions
Add optional parameters to the request
Add optional parameters to the request
Handle the response for a Tesla request
Specify the request method when building a request
Specify the request method when building a request
Link to this section Functions
Add optional parameters to the request
parameters
Parameters
- request (Map) - Collected request options
- definitions (Map) - Map of parameter name to parameter location.
- options (KeywordList) - The provided optional parameters
returns
Returns
Map
Add optional parameters to the request
parameters
Parameters
- request (Map) - Collected request options
- location (atom) - Where to put the parameter
- key (atom) - The name of the parameter
- value (any) - The value of the parameter
returns
Returns
Map
@spec decode(Tesla.Env.t() | term()) :: {:ok, struct()} | {:error, Tesla.Env.t()} | {:error, term()}
Handle the response for a Tesla request
parameters
Parameters
arg1 (Tesla.Env.t | term) - The response object
arg2 (:false | struct | [struct]) - The shape of the struct to deserialize into
returns
Returns
on success {:error, term} on failure
@spec decode(Tesla.Env.t() | term(), false | struct() | [struct()]) :: {:ok, struct()} | {:error, Tesla.Env.t()} | {:error, term()}
Specify the request method when building a request
parameters
Parameters
- request (Map) - Collected request options
- m (atom) - Request method
returns
Returns
Map
Specify the request method when building a request
parameters
Parameters
- request (Map) - Collected request options
- u (String) - Request URL
returns
Returns
Map