Factory

Fetch Response: Factory.

Describes the layout of constructors available to create new FetchResponse implementation objects, either via host-side code or, where supported, via guest-side code. Some of these constructors are driven by spec requirements whereas others are provided for host-side convenience. See individual constructor docs for more details.

See also:

  • Fetch constructors on MDN: https://developer.mozilla.org/en-US/docs/Web/API/Response/Response

Functions

Link copied to clipboard
abstract fun error(): Impl

Creates a new FetchResponse instance (of type Impl) which indicates a network-related error state.

Link copied to clipboard
abstract fun redirect(url: String, status: Int = Defaults.DEFAULT_STATUS_REDIRECT): Impl

Creates a new FetchResponse instance (of type Impl) which redirects for a given pair of URLs.