Assent.HTTPAdapter.HTTPResponse (Assent v0.4.0)

Copy Markdown View Source

Struct used by HTTP adapters to normalize HTTP responses.

The :request, :headers, and :body fields are omitted from Inspect output as they may contain sensitive data.

Examples

iex> response = %Assent.HTTPAdapter.HTTPResponse{
...>   request: %Assent.HTTPAdapter.HTTPRequest{method: :get, url: "https://example.com"},
...>   http_adapter: Assent.HTTPAdapter.Httpc,
...>   status: 200,
...>   body: "OK"
...> }
iex> inspect(response)
"#Assent.HTTPAdapter.HTTPResponse<http_adapter: Assent.HTTPAdapter.Httpc, status: 200, ...>"

Summary

Types

header()

@type header() :: {binary(), binary()}

t()

@type t() :: %Assent.HTTPAdapter.HTTPResponse{
  body: binary() | term(),
  headers: [header()],
  http_adapter: module(),
  request: Assent.HTTPAdapter.HTTPRequest.t(),
  status: integer()
}