Companion

Functions

Link copied to clipboard

The error() static method of the Response interface returns a new Response object associated with a network error.

Link copied to clipboard
fun json(data: JsAny?, init: ResponseInit = definedExternally): Response

The json() static method of the Response interface returns a Response that contains the provided JSON data as body, and a Content-Type header which is set to application/json.

Link copied to clipboard
fun redirect(url: String, status: Short = definedExternally): Response

The redirect() static method of the Response interface returns a Response resulting in a redirect to the specified URL.

fun redirect(url: URL, status: Short = definedExternally): Response