ExFattureincloud.Response (ExFattureincloud v0.1.0)

Copy Markdown View Source

A successful HTTP response. body preserves the complete API envelope; data is its "data" field, or the raw body for XML/plain text responses. pagination contains the pagination fields returned by the server.

Summary

Types

The result returned by a resource function or HTTP request.

t()

The HTTP response and data extracted from its body and headers.

Functions

Converts a successful Req response, preserving its envelope, pagination and quota headers.

Types

result()

@type result() :: {:ok, t()} | {:error, ExFattureincloud.Error.t()}

The result returned by a resource function or HTTP request.

t()

@type t() :: %ExFattureincloud.Response{
  body: term(),
  data: term(),
  headers: map(),
  pagination: map(),
  rate_limit: ExFattureincloud.RateLimit.t(),
  status: integer()
}

The HTTP response and data extracted from its body and headers.

Functions

from_req(response)

@spec from_req(Req.Response.t()) :: t()

Converts a successful Req response, preserving its envelope, pagination and quota headers.