Skip to content

Cerces


Cerces / responses / PlainTextResponse

Class: PlainTextResponse

Defined in: src/responses.ts:27

A Response subclass that casts the response body using String and sets the Content-Type header to text/plain

Extends

  • Response

Constructors

Constructor

new PlainTextResponse(body, init?): PlainTextResponse

Defined in: src/responses.ts:28

Parameters

body

any

init?

ResponseInit

Returns

PlainTextResponse

Overrides

Response.constructor

Properties

body

readonly body: null | ReadableStream<Uint8Array<ArrayBuffer>>

Defined in: node_modules/typescript/lib/lib.dom.d.ts:4468

MDN Reference

Inherited from

Response.body


bodyUsed

readonly bodyUsed: boolean

Defined in: node_modules/typescript/lib/lib.dom.d.ts:4470

MDN Reference

Inherited from

Response.bodyUsed


headers

readonly headers: Headers

Defined in: node_modules/typescript/lib/lib.dom.d.ts:26322

The headers read-only property of the with the response.

MDN Reference

Inherited from

Response.headers


ok

readonly ok: boolean

Defined in: node_modules/typescript/lib/lib.dom.d.ts:26328

The ok read-only property of the Response interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not.

MDN Reference

Inherited from

Response.ok


redirected

readonly redirected: boolean

Defined in: node_modules/typescript/lib/lib.dom.d.ts:26334

The redirected read-only property of the Response interface indicates whether or not the response is the result of a request you made which was redirected.

MDN Reference

Inherited from

Response.redirected


status

readonly status: number

Defined in: node_modules/typescript/lib/lib.dom.d.ts:26340

The status read-only property of the Response interface contains the HTTP status codes of the response.

MDN Reference

Inherited from

Response.status


statusText

readonly statusText: string

Defined in: node_modules/typescript/lib/lib.dom.d.ts:26346

The statusText read-only property of the Response interface contains the status message corresponding to the HTTP status code in Response.status.

MDN Reference

Inherited from

Response.statusText


type

readonly type: ResponseType

Defined in: node_modules/typescript/lib/lib.dom.d.ts:26352

The type read-only property of the Response interface contains the type of the response.

MDN Reference

Inherited from

Response.type


url

readonly url: string

Defined in: node_modules/typescript/lib/lib.dom.d.ts:26358

The url read-only property of the Response interface contains the URL of the response.

MDN Reference

Inherited from

Response.url

Methods

arrayBuffer()

arrayBuffer(): Promise<ArrayBuffer>

Defined in: node_modules/typescript/lib/lib.dom.d.ts:4472

MDN Reference

Returns

Promise<ArrayBuffer>

Inherited from

Response.arrayBuffer


blob()

blob(): Promise<Blob>

Defined in: node_modules/typescript/lib/lib.dom.d.ts:4474

MDN Reference

Returns

Promise<Blob>

Inherited from

Response.blob


bytes()

bytes(): Promise<Uint8Array<ArrayBuffer>>

Defined in: node_modules/typescript/lib/lib.dom.d.ts:4476

MDN Reference

Returns

Promise<Uint8Array<ArrayBuffer>>

Inherited from

Response.bytes


formData()

formData(): Promise<FormData>

Defined in: node_modules/typescript/lib/lib.dom.d.ts:4478

MDN Reference

Returns

Promise<FormData>

Inherited from

Response.formData


json()

json(): Promise<any>

Defined in: node_modules/typescript/lib/lib.dom.d.ts:4480

MDN Reference

Returns

Promise<any>

Inherited from

Response.json


text()

text(): Promise<string>

Defined in: node_modules/typescript/lib/lib.dom.d.ts:4482

MDN Reference

Returns

Promise<string>

Inherited from

Response.text


clone()

clone(): Response

Defined in: node_modules/typescript/lib/lib.dom.d.ts:26364

The clone() method of the Response interface creates a clone of a response object, identical in every way, but stored in a different variable.

MDN Reference

Returns

Response

Inherited from

Response.clone


error()

static error(): Response

Defined in: node_modules/typescript/lib/lib.dom.d.ts:26375

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

MDN Reference

Returns

Response

Inherited from

Response.error


json()

static json(data, init?): Response

Defined in: node_modules/typescript/lib/lib.dom.d.ts:26381

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.

MDN Reference

Parameters

data

any

init?

ResponseInit

Returns

Response

Inherited from

Response.json


redirect()

static redirect(url, status?): Response

Defined in: node_modules/typescript/lib/lib.dom.d.ts:26387

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

MDN Reference

Parameters

url

string | URL

status?

number

Returns

Response

Inherited from

Response.redirect