View Source CozyOSS.ApiRequest (cozy_oss v0.2.0)
Converts %ApiSpec{}
to a %ApiRequest{}
.
Link to this section Summary
Types
Optional request body.
Request headers.
Request method.
Request path.
Optional request query.
Request scheme.
Functions
Bulid a struct %CozyOSS.ApiRequest{}
from %CozyOSS.Config{}
and %CozyOSS.ApiSpec{}
.
Converts a request to a signed URL.
Link to this section Types
@type body() :: iodata() | nil
Optional request body.
Request headers.
@type method() :: String.t()
Request method.
@type path() :: String.t()
Request path.
@type query() :: %{ optional(query_name :: String.t()) => query_value :: boolean() | number() | String.t() }
Optional request query.
@type scheme() :: String.t()
Request scheme.
Link to this section Functions
@spec build!(CozyOSS.Config.t(), CozyOSS.ApiSpec.t(), keyword()) :: t()
Bulid a struct %CozyOSS.ApiRequest{}
from %CozyOSS.Config{}
and %CozyOSS.ApiSpec{}
.
This function has built-in signing support, and it's controlled by option :sign_by
:
sign_by: :header
- add signatures to request headers.sign_by: :url
- add signatures to URL.
When using sign_by: :url
, an extra option :expiration_in_seconds
is supported. The default value
is 900
.
Converts a request to a signed URL.