Home Reference Source
public class | source

Request

Constructor Summary

Public Constructor
public

constructor(client: Object, event: Object, frame: Frame, redirectChain: Array<Request>, interceptionId: string, allowInterception: boolean)

Member Summary

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

_purl: URL

private
private
private
private
private
private
private
private
private

Method Summary

Public Methods
public

async abort(errorCode: string=)

public

async continue(overrides: {url?: string, method?: string, postData?: string, headers?: !Object})

public
public

failure(): {errorText: string}

public
public
public
public

async getPostData(): Promise<Buffer>

Returns post data sent with the request.

public
public
public

header(header: string): string

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

public

Returns the HTTP headers as sent by the browser.

public
public
public
public
public
public
public
public
public

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

public

parsedURL(): URL

public
public
public
public
public
public

requestLine(noHTTP2Plus: boolean): string

public
public
public

async respond(response: {status: number, headers: Object, contentType: string, body: string|Buffer})

public
public
public

toJSON(): {headers: Object, initialPriority: string, method: string, referrerPolicy: string, frameId: string, mixedContentType: ?string, documentURL: string, initiator: string, loaderId: string, hasPostData: ?boolean, urlFragment: ?string, type: string, url: string, isLinkPreload: boolean, requestId: string, response: ?Response, hasUserGesture: boolean, wallTime: number, fromMemoryCache: boolean, postData: ?string, timestamp: number}

public
public

url(): string

public
public

Public Constructors

public constructor(client: Object, event: Object, frame: Frame, redirectChain: Array<Request>, interceptionId: string, allowInterception: boolean) source

Params:

NameTypeAttributeDescription
client Object
event Object
frame Frame
  • nullable: true
redirectChain Array<Request>
interceptionId string
allowInterception boolean

Protected Members

protected _client: Object source

Private Members

private _allowInterception: boolean source

private _checkRedoNormalization: boolean source

private _documentURL: string source

private _failureText: string source

private _frame: Frame source

private _frameId: string source

private _fromMemoryCache: boolean source

private _fullHeaders: Object source

private _hasPostData: boolean source

private _hasUserGesture: boolean source

private _headers: Object source

private _headersLower: Object source

private _headersText: string source

private _initialPriority: string source

private _initiator: string source

private _interceptionHandled: boolean source

private _interceptionId: string source

private _isLinkPreload: boolean source

private _isNavigationRequest: boolean source

private _loaderId: string source

private _method: string source

private _mixedContentType: string source

private _postData: string source

private _protocol: string source

private _purl: URL source

private _redirectChain: Array<Request> source

private _referrerPolicy: string source

private _requestId: string source

private _response: Response source

private _timestamp: number source

private _type: string source

private _url: string source

private _urlFragment: string source

private _wallTime: number source

Public Methods

public async abort(errorCode: string=) source

Params:

NameTypeAttributeDescription
errorCode string=

public async continue(overrides: {url?: string, method?: string, postData?: string, headers?: !Object}) source

Params:

NameTypeAttributeDescription
overrides {url?: string, method?: string, postData?: string, headers?: !Object}
  • nullable: false

public documentURL(): string source

Return:

string

public failure(): {errorText: string} source

Return:

{errorText: string} (nullable: true)

public frame(): Frame source

Return:

Frame (nullable: true)

public frameId(): string source

Return:

string

public fromMemoryCache(): boolean source

Return:

boolean

public async getPostData(): Promise<Buffer> source

Returns post data sent with the request. Returns an error when no data was sent with the request

Return:

Promise<Buffer>

See:

public hasPostData(): boolean source

Return:

boolean (nullable: true)

public hasUserGesture(): boolean source

Return:

boolean

public header(header: string): string source

Returns the value for the supplied header (case insensitive) if it exists. See Request#normalizedHeaders and Request#headers for more details

Params:

NameTypeAttributeDescription
header string

Return:

string (nullable: true)

public headers(): Object source

Returns the HTTP headers as sent by the browser. If the full request HTTP headers are available (CDPResponse.requestHeaders) they are returned otherwise the value of CDPRequest.headers are returned.

Return:

Object

public headersText(): string source

Return:

string (nullable: true)

public initialPriority(): string source

Return:

string

public initiator(): string source

Return:

string

public isLinkPreload(): boolean source

Return:

boolean

public isNavigationRequest(): boolean source

Return:

boolean

public loaderId(): string source

Return:

string

public method(): string source

Return:

string

public mixedContentType(): string source

Return:

string (nullable: true)

public normalizedHeaders(): Object source

Returns the normalized (header keys in lowercase) HTTP headers as sent by the browser. See Request#headers for more details

Return:

Object

public parsedURL(): URL source

Return:

URL

public postData(): string source

Return:

string (nullable: true)

public protocol(): string source

Return:

string (nullable: true)

public redirectChain(): Array<Request> source

Return:

Array<Request>

public referrerPolicy(): string source

Return:

string

public requestId(): string source

Return:

string

public requestLine(noHTTP2Plus: boolean): string source

Params:

NameTypeAttributeDescription
noHTTP2Plus boolean
  • optional

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

Return:

string

public requestLineAndHeaders(noHTTP2Plus: boolean): string source

Params:

NameTypeAttributeDescription
noHTTP2Plus boolean
  • optional

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

Return:

string

public resourceType(): * source

Return:

*

public async respond(response: {status: number, headers: Object, contentType: string, body: string|Buffer}) source

Params:

NameTypeAttributeDescription
response {status: number, headers: Object, contentType: string, body: string|Buffer}
  • nullable: false

public response(): Response source

Return:

Response (nullable: true)

public timestamp(): number source

Return:

number

public toJSON(): {headers: Object, initialPriority: string, method: string, referrerPolicy: string, frameId: string, mixedContentType: ?string, documentURL: string, initiator: string, loaderId: string, hasPostData: ?boolean, urlFragment: ?string, type: string, url: string, isLinkPreload: boolean, requestId: string, response: ?Response, hasUserGesture: boolean, wallTime: number, fromMemoryCache: boolean, postData: ?string, timestamp: number} source

Return:

{headers: Object, initialPriority: string, method: string, referrerPolicy: string, frameId: string, mixedContentType: ?string, documentURL: string, initiator: string, loaderId: string, hasPostData: ?boolean, urlFragment: ?string, type: string, url: string, isLinkPreload: boolean, requestId: string, response: ?Response, hasUserGesture: boolean, wallTime: number, fromMemoryCache: boolean, postData: ?string, timestamp: number}

public type(): string source

Return:

string

public url(): string source

Return:

string

public urlFragment(): string source

Return:

string (nullable: true)

public wallTime(): number source

Return:

number