Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a page request.

Hierarchy

  • Request

Index

Methods

abort

  • abort(errorCode?: "aborted" | "accessdenied" | "addressunreachable" | "blockedbyclient" | "blockedbyresponse" | "connectionaborted" | "connectionclosed" | "connectionfailed" | "connectionrefused" | "connectionreset" | "internetdisconnected" | "namenotresolved" | "timedout" | "failed"): Promise<void>
  • Aborts request. To use this, request interception should be enabled with page.setRequestInterception.

    throws

    An exception is immediately thrown if the request interception is not enabled.

    Parameters

    • Optional errorCode: "aborted" | "accessdenied" | "addressunreachable" | "blockedbyclient" | "blockedbyresponse" | "connectionaborted" | "connectionclosed" | "connectionfailed" | "connectionrefused" | "connectionreset" | "internetdisconnected" | "namenotresolved" | "timedout" | "failed"

    Returns Promise<void>

continue

  • continue(overrides?: Overrides): Promise<void>
  • Continues request with optional request overrides. To use this, request interception should be enabled with page.setRequestInterception.

    throws

    An exception is immediately thrown if the request interception is not enabled.

    Parameters

    Returns Promise<void>

failure

  • failure(): null | { errorText: string }
  • Returns null | { errorText: string }

    An object if the request failed, null otherwise.

frame

  • Returns null | Frame

    The Frame object that initiated the request, or null if navigating to error pages

headers

  • headers(): Record<string, string>
  • An object with HTTP headers associated with the request. All header names are lower-case.

    Returns Record<string, string>

isNavigationRequest

  • isNavigationRequest(): boolean
  • Whether this request is driving frame's navigation.

    Returns boolean

method

  • Returns the request's method (GET, POST, etc.)

    Returns HttpMethod

postData

  • postData(): undefined | string
  • Contains the request's post body, if any.

    Returns undefined | string

redirectChain

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

    • If there are no redirects and the request was successful, the chain will be empty.
    • If a server responds with at least a single redirect, then the chain will contain all the requests that were redirected.

    redirectChain is shared between all the requests of the same chain.

    since

    1.2.0

    Returns Request[]

resourceType

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

    Returns ResourceType

respond

  • Fulfills request with given response. To use this, request interception should be enabled with page.setRequestInterception.

    throws

    An exception is immediately thrown if the request interception is not enabled.

    Parameters

    • response: RespondOptions

      The response options that will fulfill this request.

    Returns Promise<void>

response

  • A matching Response object, or null if the response has not been received yet.

    Returns null | Response

url

  • url(): string
  • Contains the URL of the request.

    Returns string

Generated using TypeDoc