Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Response<T>

General response object whose properties is common in both XMLHttpRequest and fetch.

Type parameters

  • T: "xhr" | "fetch"

Hierarchy

Index

Properties

ajaxType

ajaxType: T

"xhr" or "fetch".

When a request is generated by XMLHttpRequest, then ajaxType is "xhr".

When a request is generated by window.fetch, then ajaxType is "fetch".

Optional body

body: T extends "xhr" ? BodyInit | null | Document | Record<string, unknown> : BodyInit | null

A request body.

BodyInit: Blob | BufferSource | FormData | URLSearchParams | ReadableStream<Uint8Array> | string

headers

headers: Record<string, string>

Key-value pairs of a header.

example
{
  "Content-Type": "application/json; charset=utf-8",
  "X-API-Limit": 100
}

status

status: number

statusText

statusText: string

Generated using TypeDoc