Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RequestByXHR

Request object properties only for XMLHttpRequest.

see

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

Hierarchy

Index

Properties

ajaxType

ajaxType: "xhr"

"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 async

async: undefined | false | true

Optional body

body: "xhr" extends "xhr" ? BodyInit | null | Document : 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
var request = {
  headers: {
    "Content-Type": "text/html",
    "Authorization": "xxxxxxx"
  }
};

method

method: string

Http method like GET, POST and so on.

Optional password

password: string | null

Optional responseType

responseType: XMLHttpRequestResponseType

timeout

timeout: number

timeout is only used by XMLHttpRequest.

Optional upload

upload: XMLHttpRequestUpload

url

url: string

Request url to send request.

Optional username

username: string | null

Optional withCredentials

withCredentials: undefined | false | true

Generated using TypeDoc