Home Reference Source
public class | source

Response

Constructor Summary

Public Constructor
public

constructor(client: Object, request: Request, event: Object)

Member Summary

Protected Members
protected
protected
protected
protected
protected
protected
protected
protected
protected
protected
protected
protected
protected
protected
protected
protected
protected
protected
protected
protected
protected
protected
Private Members
private
private
private
private
private

_purl: URL

private
private
private

Method Summary

Public Methods
public

buffer(): Promise<Buffer>

public
public
public
public
public
public
public
public
public

header(header: string): string

Returns the value for the supplied header (case insensitive) if it exists

public
public

Returns the responses (status line and headers with CRLF) as sent by the browser if they were included with the response

public

async json(): Promise<Object>

public
public
public

Returns the normalized (header keys lowercase) HTTP headers as sent by the browser.

public

ok(): boolean

public

parsedURL(): URL

public
public

remoteAddress(): {port: number, ip: string}

public
public
public
public

Returns the full request (the one generating this response) HTTP headers as sent by the browser if they were included with the response

public

Returns the full request's (the one generating this response) HTTP headers (request line and headers with CRLF) as sent by the browser if they were included with the response

public
public
public
public
public

statusLine(noHTTP2Plus: boolean): string

public
public
public

async text(): Promise<string>

public
public
public

toJSON(): {headers: Object, securityDetails: SecurityDetails, frameId: string, connectionReused: boolean, timing: Object, loaderId: string, encodedDataLength: number, remotePort: number, mimeType: string, type: string, headersText: ?string, securityState: string, url: string, requestHeadersText: ?string, protocol: string, requestHeaders: ?Object, fromDiskCache: boolean, fromServiceWorker: boolean, remoteIPAddress: string, requestId: string, statusText: string, timestamp: number, status: number}

public
public

url(): string

Public Constructors

public constructor(client: Object, request: Request, event: Object) source

Params:

NameTypeAttributeDescription
client Object
request Request
  • nullable: true
event Object

Protected Members

protected _client: Object source

protected _connectionReused: boolean source

protected _encodedDataLength: number source

protected _frameId: string source

protected _fromDiskCache: boolean source

protected _fromServiceWorker: boolean source

protected _headers: Object source

protected _headersText: string source

protected _loaderId: string source

protected _mimeType: string source

protected _protocol: string source

protected _remoteIPAddress: string source

protected _remotePort: number source

protected _request: Request source

protected _requestHeaders: Object source

protected _requestHeadersText: string source

protected _requestId: string source

protected _status: number source

protected _statusText: string source

protected _timestamp: number source

protected _type: string source

protected _url: string source

Private Members

private _bodyLoadedPromise: * source

private _bodyLoadedPromiseFulfill: function() source

private _contentPromise: Promise<Buffer> source

private _headersLower: Object source

private _purl: URL source

private _securityDetails: SecurityDetails source

private _securityState: string source

private _timing: Object source

Public Methods

public buffer(): Promise<Buffer> source

Return:

Promise<Buffer>

public connectionReused(): boolean source

Return:

boolean

public documentURL(): string source

Return:

string

public encodedDataLength(): number source

Return:

number

public frame(): Frame source

Return:

Frame (nullable: true)

public frameId(): string source

Return:

string

public fromCache(): boolean source

Return:

boolean

public fromDiskCache(): boolean source

Return:

boolean

public fromServiceWorker(): boolean source

Return:

boolean

public header(header: string): string source

Returns the value for the supplied header (case insensitive) if it exists

Params:

NameTypeAttributeDescription
header string

Return:

string (nullable: true)

public headers(): Object source

Return:

Object

public headersText(): string source

Returns the responses (status line and headers with CRLF) as sent by the browser if they were included with the response

Return:

string (nullable: true)

public async json(): Promise<Object> source

Return:

Promise<Object>

public loaderId(): string source

Return:

string

public mimeType(): string source

Return:

string

public normalizedHeaders(): Object source

Returns the normalized (header keys lowercase) HTTP headers as sent by the browser.

Return:

Object

public ok(): boolean source

Return:

boolean

public parsedURL(): URL source

Return:

URL

public protocol(): string source

Return:

string

public remoteAddress(): {port: number, ip: string} source

Return:

{port: number, ip: string}

public remoteIPAddress(): string source

Return:

string

public remotePort(): number source

Return:

number

public request(): Request source

Return:

Request (nullable: true)

public requestHeaders(): Object source

Returns the full request (the one generating this response) HTTP headers as sent by the browser if they were included with the response

Return:

Object (nullable: true)

public requestHeadersText(): string source

Returns the full request's (the one generating this response) HTTP headers (request line and headers with CRLF) as sent by the browser if they were included with the response

Return:

string (nullable: true)

public requestId(): string source

Return:

string

public securityDetails(): SecurityDetails source

Return:

SecurityDetails (nullable: true)

public securityState(): string source

Return:

string (nullable: true)

public status(): number source

Return:

number

public statusLine(noHTTP2Plus: boolean): string source

Params:

NameTypeAttributeDescription
noHTTP2Plus boolean
  • optional

When true if the request was made via HTTP2 the protocol is forced to HTTP/1.1

Return:

string

public statusLineAndHeaders(noHTTP2Plus: boolean): string source

Params:

NameTypeAttributeDescription
noHTTP2Plus boolean
  • optional

When true if the request was made via HTTP2 the protocol is forced to HTTP/1.1

Return:

string

public statusText(): string source

Return:

string

public async text(): Promise<string> source

Return:

Promise<string>

public timestamp(): number source

Return:

number

public timing(): Object source

Return:

Object

public toJSON(): {headers: Object, securityDetails: SecurityDetails, frameId: string, connectionReused: boolean, timing: Object, loaderId: string, encodedDataLength: number, remotePort: number, mimeType: string, type: string, headersText: ?string, securityState: string, url: string, requestHeadersText: ?string, protocol: string, requestHeaders: ?Object, fromDiskCache: boolean, fromServiceWorker: boolean, remoteIPAddress: string, requestId: string, statusText: string, timestamp: number, status: number} source

Return:

{headers: Object, securityDetails: SecurityDetails, frameId: string, connectionReused: boolean, timing: Object, loaderId: string, encodedDataLength: number, remotePort: number, mimeType: string, type: string, headersText: ?string, securityState: string, url: string, requestHeadersText: ?string, protocol: string, requestHeaders: ?Object, fromDiskCache: boolean, fromServiceWorker: boolean, remoteIPAddress: string, requestId: string, statusText: string, timestamp: number, status: number}

public type(): string source

Return:

string

public url(): string source

Return:

string