TypeSafe.HTTP.Response (TypeSafe AI v0.1.0-alpha.1)

Copy Markdown View Source

A successful raw response: the decoded JSON body plus the metadata the typed layer and support conversations need.

TypeSafe.HTTP.post/4 and get/3 return only the body, which is enough for most raw callers. TypeSafe.HTTP.request/5 returns this struct so callers can also read the status, headers, and the x-typesafe-request-id header that TypeSafe support asks for.

Summary

Types

t()

@type t() :: %TypeSafe.HTTP.Response{
  body: map(),
  headers: %{required(String.t()) => [String.t()]},
  request_id: String.t() | nil,
  retry_count: non_neg_integer(),
  status: pos_integer()
}