ResourceResponse

Resource requests are the raw underlying http request details made to access a resource.

Instances of this class are associated with a resource returned from window.waitForResource or from the initial window document load.

Properties

browserServedFromCache

Will have a value if http response was served from a browser cache.

ReturnsPromise<null | 'service-worker' | 'disk' | 'prefetch' | 'memory'>

browserLoadFailure

Will have a value if an http error occurred loading this request.

ReturnsPromise<string | null>

headers

Retrieve the actual headers returned to the client (order and casing is preserved)

ReturnsPromise<{ [name: string]: string }>

url

The response url (if redirected).

ReturnsPromise<string>

timestamp

ISO formatted date string.

ReturnsPromise<string>

remoteAddress

IPv4/6 and port of remote socket. 192.168.172.2:5001

ReturnsPromise<string>

statusCode

Http response status code.

NOTE: this value might be null if no HTTP response occurred, or an error occurred.

ReturnsPromise<number>

statusText

Http response status message.

ReturnsPromise<string>

data

Load the underlying buffer returned by this network response.

ReturnsPromise<Buffer>

Methods

text()

Convert the returned resource body to a string.

ReturnsPromise<string>

json()

Convert the returned resource body into json.

ReturnsPromise<json>

Edit this page on GitHub