Response

@native @JSGlobal @JSType
class Response(content: BodyInit, init: ResponseInit) extends Body

ΒΆ6.4 Response class in whatwg spec

Value parameters:
content

optional content

init

optional response initialisiton

Companion:
object
trait Body
class Object
trait Any
class Object
trait Matchable
class Any

Value members

Concrete methods

Contains the type of the response

Contains the type of the response

override def clone(): Response
Definition Classes
Object
def ok: Boolean

Contains a boolean stating whether the response was successful (status in the range 200-299) or not.

Contains a boolean stating whether the response was successful (status in the range 200-299) or not.

Contains the status message corresponding to the status code (e.g., OK for 200).

Contains the status message corresponding to the status code (e.g., OK for 200).

def url: String

Contains the URL of the response.

Contains the URL of the response.

Inherited methods

def arrayBuffer(): Promise[ArrayBuffer]

Takes a Response stream and reads it to completion. It returns a promise that resolves with an ArrayBuffer.

Takes a Response stream and reads it to completion. It returns a promise that resolves with an ArrayBuffer.

Inherited from:
Body
def blob(): Promise[Blob]

Takes a Response stream and reads it to completion. It returns a promise that resolves with a Blob.

Takes a Response stream and reads it to completion. It returns a promise that resolves with a Blob.

Inherited from:
Body
def bodyUsed: Boolean

Contains a Boolean that indicates whether the body has been read.

Contains a Boolean that indicates whether the body has been read.

Inherited from:
Body
def formData(): Promise[FormData]

Takes a Response stream and reads it to completion. It returns a promise that resolves with a FormData object.

Takes a Response stream and reads it to completion. It returns a promise that resolves with a FormData object.

Inherited from:
Body
def hasOwnProperty(v: String): Boolean
Inherited from:
Object
def isPrototypeOf(v: Object): Boolean
Inherited from:
Object
def json(): Promise[Any]

Takes a Response stream and reads it to completion. It returns a promise that resolves with a JSON object.

Takes a Response stream and reads it to completion. It returns a promise that resolves with a JSON object.

Inherited from:
Body
def propertyIsEnumerable(v: String): Boolean
Inherited from:
Object
def text(): Promise[String]

Takes a Response stream and reads it to completion. It returns a promise that resolves with a USVString (text).

Takes a Response stream and reads it to completion. It returns a promise that resolves with a USVString (text).

Inherited from:
Body
def toLocaleString(): String
Inherited from:
Object
def valueOf(): Any
Inherited from:
Object

Concrete fields

val body: ReadableStream[Uint8Array]

Contains the Headers object associated with the response.

Contains the Headers object associated with the response.

val status: Int

Contains the status code of the response (e.g., 200 for a success).

Contains the status code of the response (e.g., 200 for a success).