Auth0Client.Parser (auth0_client v1.0.0)

Copy Markdown View Source

Parser to parse all the responses from Auth0 API endpoints.

Req decodes JSON response bodies automatically, so a successful response carries an already-decoded term. Bodies that are not JSON — an HTML error page, say — are passed through as the raw binary Req produced.

Every failure becomes an Auth0Client.Error, which carries the response headers so callers can honour Retry-After on a 429.

Summary

Functions

Parses the response from auth0 api calls

Types

body()

@type body() :: map() | list() | binary()

response()

@type response() :: {:ok, body()} | :ok | {:error, Auth0Client.Error.t()}

status_code()

@type status_code() :: non_neg_integer()

Functions

parse(arg)

@spec parse({:ok, Req.Response.t()} | {:error, Exception.t()}) :: response()

Parses the response from auth0 api calls