← Back to Features
Pro

Request Mocker

Request Mocker changes network traffic in the browser without touching the backend — block requests, set or remove request and response headers, and return your own status codes, bodies and delays so you can test states the real API will not produce on demand.

Some states are painfully hard to reach. An empty dashboard needs an empty response, a retry banner needs a 500, a loading skeleton needs a slow endpoint, and a frontend needs an endpoint that does not exist yet. Normally each one means a backend change, a seeded database or a commented-out line you hope not to ship.

Request Mocker produces those states in the browser. Match a URL by substring or with wildcards, then decide what happens: block the request so the page sees a failure, rewrite request or response headers on the fly, or return a canned response with the status code, content type, body and delay of your choosing. The page cannot tell the difference, so your real error handling, empty states and timeouts all run for real.

Blocking and header rewriting use Chrome's declarativeNetRequest rules, so they apply to everything the page requests, including on reload. Faked responses are served to fetch and XMLHttpRequest from inside the page, and the panel logs each one as it is served along with a hit counter per rule, so you can see at a glance whether your rule is matching what you think it is.

Rules are deliberately easy to get rid of. They are saved per site, apply only to the current tab, and every one of them is removed the moment you close the tool — so there is no way to spend an afternoon debugging a problem that turns out to be a mock you forgot was running.

Live Preview
app.example.com
Request Mocker 3 rules active on this tab
New rule
Mock response GET /api/orders
Status 500 Delay ms 1200 Add rule
Rules
mock GET /api/orders → 500 7 ●
block ANY analytics.vendor.com/* ●
headers ANY /api/* → Cache-Control: no-store ●
Mocked responses served
GET 500 /api/orders?page=1 · fetch · 14:22:07
GET 500 /api/orders?page=2 · fetch · 14:22:11
Key Features

Block Any Request

Stop a request from ever leaving, matched by URL and method, and watch how the page behaves when a script, image, tracker or API call simply never arrives.

Rewrite Headers On The Fly

Set or remove request and response headers — add an Authorization header, force Cache-Control: no-store, or strip a header to see what breaks — without any server change.

Return Your Own Responses

Serve a body you write with the status code and content type you choose. Perfect for empty lists, malformed payloads and endpoints that do not exist yet.

Simulate Errors and Slow Networks

Return a 500, a 429 or a 404 on demand, and add a delay in milliseconds to hold the response back so loading states, spinners and timeout handling can be tested properly.

Substring or Wildcard Matching

Match loosely with a fragment like /api/users, or precisely with wildcards like *.example.com/v1/*, and narrow any rule to a single HTTP method.

Saved Per Site, Cleared On Exit

Rules belong to the site you created them on and apply to the current tab only. Closing the tool removes every active rule, so nothing keeps intercepting traffic behind your back.

Common Use Cases

Testing empty states

Return an empty array for a list endpoint and see whether your UI shows a proper empty state or an awkward blank panel.

Forcing error handling to run

Make an endpoint return 500 or 429 on demand to check that the retry banner, toast and fallback copy all actually appear.

Building against an API that does not exist yet

Mock the agreed response shape and build the whole frontend against it while the backend is still being written.

Diagnosing third-party scripts

Block an analytics, chat or ad script to confirm whether it is the thing slowing the page down or breaking a layout.

Checking slow-network behaviour

Add a two-second delay to one endpoint and watch how skeletons, spinners and timeouts hold up when a single call lags.

How to Use
1

Open Request Mocker

Click the Request Mocker icon in the DevSuite Pro dock. The panel opens with a rule form on top and your saved rules for this site below it.

2

Choose what should happen

Pick Block request, Edit headers or Mock response, and optionally limit the rule to one method such as POST.

3

Say which URLs to match

Enter a substring such as /api/users, or use wildcards such as *.example.com/v1/*. Choose whether the rule covers only fetch and XHR calls or every request type.

4

Fill in the details and add it

For headers, write them one per line — Name: value to set one, Name: on its own to remove it. For a mock, set the status, delay, content type and body. Click Add rule and it applies immediately.

5

Watch it work, then close

Reload or use the page and the log shows each faked response as it is served, with a hit count beside each rule. Toggle, edit or delete rules as you go; closing the tool clears them all.

Ready to Try

Install DevSuite Pro for free and unlock 71+ developer tools for your browser.

Add to Chrome Add to Edge Add to FireFox