Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RequestByFetch

Request object properties only for fetch.

see

https://developer.mozilla.org/en-US/docs/Web/API/Request

Hierarchy

Index

Properties

ajaxType

ajaxType: "fetch"

"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: BodyInit | null

A request body to be sent with method like POST, PUT and so on.

body can be various type like string, FormData, Document, Blob, URLSearchParams and so on.

see

https://developer.mozilla.org/en-US/docs/Web/API/Body/body

Optional cache

cache: RequestCache

Optional credentials

credentials: RequestCredentials

headers

headers: Record<string, string>

Key-value pairs of a header.

example
var request = {
  headers: {
    "Content-Type": "text/html",
    "Authorization": "xxxxxxx"
  }
};

Optional integrity

integrity: undefined | string

Optional keepalive

keepalive: undefined | false | true

method

method: string

Optional mode

mode: RequestMode

Optional redirect

redirect: RequestRedirect

Optional referrer

referrer: undefined | string

Optional referrerPolicy

referrerPolicy: ReferrerPolicy

Optional signal

signal: AbortSignal | null

timeout

timeout: number

timeout is only used by XMLHttpRequest.

url

url: string

Generated using TypeDoc