Core
HttpResponse
Wire-shape HTTP response that transports produce and interceptors accept.
@defjs/core · Type
Signature
type HttpResponse<R> = { readonly [HTTP_RESPONSE]: true; readonly url: string; readonly status: number; readonly statusText: string; readonly headers: Headers; readonly body: R | null | undefined; readonly ok: boolean; };
body is parsed JSON, text, a Blob, or an ArrayBuffer, according to
responseType, not a decoded struct value. body is undefined when no body
was present; a JSON null stays null. For a JSON representation, a string
is a JSON string root and is not parsed again; bytes and blobs are raw and
are parsed once. ok is true for status codes in the 2xx range. A transport
failure is a fault, never a response. DecodedResponse is what reaches the
caller. The symbol key is an internal brand. Build values with makeResponse.
Members
Prop
Type
url stringstatus numberstatusText stringheaders Headersbody R | null | undefinedAbsent when no body was present. JSON null stays null.
ok boolean