Browser

Create a mock rule

Adds a URL-matching rule that intercepts requests. Actions include respond (return a mock response), fail (abort the request), and modify (rewrite the request URL).

post/v1/browser/mocks

Request

  • Base URL: http://localhost:9998
  • URL: http://localhost:9998/v1/browser/mocks
  • Auth: HTTP bearer

Request body

urlPatternstring required

URL pattern to match (glob or substring)

methodstring nullable

HTTP method filter (e.g. "GET", "POST")

requestStagestring

CDP Fetch stage (default: "Request")

actionstring required

Action type: "respond", "fail", or "modify"

statusinteger

HTTP status code for respond action

headersobject

Response headers for respond action

bodystring

Response body for respond action

failReasonstring

Failure reason for fail action (e.g. "Failed", "TimedOut")

modifyUrlstring

New URL for modify action

descriptionstring
enabledboolean

Whether the rule is active (default: true)

Response

Created mock rule

idstring required
urlPatternstring required
methodstring nullable
requestStagestring required

CDP Fetch request stage (e.g. "Request", "Response")

descriptionstring nullable
enabledboolean required

Changes

No recorded changes to this operation across all 1 revision of this API.