Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ResponseByFetch

Response object properties only for fetch.

see

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

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

body

body: BodyInit | null

Although original fetch response body is ReadableStream of Uint8Array, you can specify value of body in various type like just a string.

example
var response = {
  ...,
  body: "{\"key\":\"value\"}", // This will be converted to json after `response.json()` is called in user script.
};
see

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

headers

headers: Record<string, string>

ok

ok: boolean

redirected

redirected: boolean

type

type: ResponseType

url

url: string

Generated using TypeDoc