CPub.Web.Authentication.OAuthRequest (CPub v0.3.0) View Source

Replacement for OAuth2.Request which uses CPub.HTTP to make requests.

Link to this section Summary

Functions

Makes a request of given type to the given URL using the OAuth2.AccessToken.

Same as request/6 but returns OAuth2.Response or raises an error if an error occurs during the request.

Link to this section Functions

Link to this function

request(method, client, url, body \\ "", headers \\ [], opts \\ [])

View Source

Specs

request(
  atom(),
  OAuth2.Client.t(),
  String.t(),
  any(),
  OAuth2.Client.headers(),
  keyword()
) ::
  {:ok, OAuth2.Response.t()}
  | {:ok, reference()}
  | {:error, OAuth2.Response.t()}
  | {:error, OAuth2.Error.t()}

Makes a request of given type to the given URL using the OAuth2.AccessToken.

Link to this function

request!(method, client, url, body, headers, opts)

View Source

Specs

Same as request/6 but returns OAuth2.Response or raises an error if an error occurs during the request.

An OAuth2.Error exception is raised if the request results in an error tuple ({:error, reason}).