Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
class HTTPRequest
Re-export
import { HTTPRequest } from "https://deno.land/x/puppeteer@14.1.1/vendor/puppeteer-core/puppeteer/api-docs-entry.d.ts";

Represents an HTTP request sent by a page.

Constructors

new
HTTPRequest(
client: CDPSession,
frame: Frame,
interceptionId: string,
allowInterception: boolean,
redirectChain: HTTPRequest[],
)

Properties

private
_abort
private
_abortErrorReason
private
_allowInterception
private
_client
private
_continue
private
_continueRequestOverrides
private
_frame
private
_headers
private
_initiator
private
_interceptHandlers
private
_interceptionHandled
private
_interceptResolutionState
private
_isNavigationRequest
private
_method
private
optional
_postData
private
_resourceType
private
_respond
private
_responseForRequest
private
_url
_failureText: any
_fromMemoryCache: boolean
_interceptionId: string
_redirectChain: HTTPRequest[]
_requestId: string
_response: HTTPResponse | null

Methods

abort(errorCode?: ErrorCode, priority?: number): Promise<void>

Aborts a request.

continue(overrides?: ContinueRequestOverrides, priority?: number): Promise<void>

Continues request with optional request overrides.

enqueueInterceptAction(pendingHandler: () => void | PromiseLike<unknown>): void

Adds an async request handler to the processing queue. Deferred handlers are not guaranteed to execute in any particular order, but they are guaranteed to resolve before the request interception is finalized.

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

Access information about the request's failure.

finalizeInterceptions(): Promise<void>

Awaits pending interception handlers and then decides how to fulfill the request interception.

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

A redirectChain is a chain of requests initiated to fetch a resource.

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

respond(response: Partial<ResponseForRequest>, priority?: number): Promise<void>

Fulfills a request with the given response.

url(): string