Methods
url
Returns the URL of the response.string
ok
Returns whether the response was successful (status in the range 200-299).boolean
status
Returns the HTTP status code.number
statusText
Returns the HTTP status text.string
headers
Returns the response headers.Object
allHeaders
Returns all response headers.Promise<Object>
headersArray
Returns the response headers as an array of objects.Promise<Array<{name: string, value: string}>>
headerValue
Returns the value of a specific header.string
required
The header name (case-insensitive)
Promise<string | null>
headerValues
Returns all values of a specific header.string
required
The header name (case-insensitive)
Promise<string[]>
body
Returns the response body as a Buffer.Promise<Buffer>
text
Returns the response body as text.Promise<string>
json
Parses the response body as JSON.Promise<object>
request
Returns the request that initiated this response.Request
frame
Returns the frame that initiated the request.Frame
fromServiceWorker
Returns whether the response was served by a service worker.boolean
finished
Waits for the response to finish loading.Promise<null>
serverAddr
Returns the server IP address and port.Promise<{ipAddress: string, port: number} | null>
securityDetails
Returns SSL and other security information.Promise<Object | null>
httpVersion
Returns the HTTP version.Promise<string>
