Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/pptr/src/HTTPRequest.ts>HTTPRequest

Headless Chrome Deno API
Latest
class HTTPRequest
import { HTTPRequest } from "https://deno.land/x/pptr@1.2.0/src/HTTPRequest.ts";

Represents an HTTP request sent by a page.

Constructors

new
HTTPRequest(
client: CDPSession,
frame: Frame,
interceptionId: string,
allowInterception: boolean,
event: Protocol.Network.RequestWillBeSentEvent,
redirectChain: HTTPRequest[],
)

Properties

private
_allowInterception: boolean
private
_client: CDPSession
private
_frame: Frame
private
_headers: Record<string, string>
private
_interceptionHandled: boolean
private
_isNavigationRequest: boolean
private
_method: string
private
optional
_postData: string
private
_resourceType: string
private
_url: string
_failureText: string | null
_fromMemoryCache: boolean
_interceptionId: string
_redirectChain: HTTPRequest[]
_requestId: string
_response: HTTPResponse | null

Methods

abort(errorCode?: ErrorCode): Promise<void>

Aborts a request.

continue(overrides?: ContinueRequestOverrides): Promise<void>

Continues request with optional request overrides.

failure(): { errorText: string; } | null

Access information about the request's failure.

frame(): Frame | null
headers(): Record<string, string>
method(): string
postData(): string | undefined
resourceType(): string

Contains the request's resource type as it was perceived by the rendering engine.

respond(response: ResponseForRequest): Promise<void>

Fulfills a request with the given response.

url(): string