Override and mock responses

An Override response rule changes what the page’s fetch and XMLHttpRequest calls receive.

Status code and body

  • Status code (200 to 599): leave empty to keep the real status. Set 500, 401, 404 or 429 to test error states.
  • Response body: any text. Valid JSON is sent as application/json, anything else as text/plain. Format JSON tidies it up.
  • HEAD requests and the statuses that can’t have a body (204, 205, 304) get no body.

Mock mode or passthrough

  • Serve without network call (mock mode): the request is never sent and the response is created in the browser. Use it for endpoints that don’t exist yet, or to work offline.
  • Without it (passthrough): the real request goes out with its method, headers, body and cookies, and only the response the page sees is replaced. The original headers are kept.

Examples

You want Pattern Status Body Mock
An empty list /api/orders [] yes
A server error /api/checkout 500 {"error":"internal"} yes
A failed save (POST only) /api/profile 422 {"errors":{"name":"required"}} yes
Rate limiting /api/search 429 {"error":"too many requests"} yes
A new field on real data use a dynamic response

What DevTools shows

The extension changes the response the page’s code receives, after Chrome has recorded the request, so DevTools → Network shows the original response. Every override is logged to the page console as [Placebo API] mocked by rule … → GET https://…, which is the quickest way to check a rule applied.

What can’t be overridden

Override rules cover fetch and XMLHttpRequest from the page and its frames. Not covered: page navigations, <script> and <img> tags, CSS, Web Workers and Service Workers, navigator.sendBeacon, form submissions and synchronous XHR. For scripts, styles and images, use a redirect to another URL (a data: URL works too).

Something unclear or missing? Tell me, and I'll fix the docs.