Start hereTutorials·12 min read

Proxy Interceptor Tutorial: Intercept and Modify HTTP Requests in 5 Exercises

Zero to first request.

Five short exercises that take you from "what is a proxy interceptor?" to mocking, deep-merging, failing and redirecting real API calls, with copy-paste rules.

The short version

  • You need Chrome and a free ProxyCeptor account; no certificates or system proxy.
  • Every exercise uses one JSON rule you can paste, export or share with your team.
  • By the end you can reproduce almost any front-end API bug on demand.

What you will learn

A proxy interceptor lets you change HTTP traffic between an app and its server. Security tools like Burp do this by pausing each request for manual edits. For day-to-day development, rules are faster: describe what to match and what to change once, and it happens on every matching request.

We use the free public API https://jsonplaceholder.typicode.com so you can follow along without a backend of your own.

Setup (2 minutes)

  1. Create a free ProxyCeptor account and open the dashboard.
  2. Load the ProxyCeptor extension in Chrome and open DevTools (F12). Select the ProxyCeptor panel.
  3. Open any page and run fetch("https://jsonplaceholder.typicode.com/users/1").then(r => r.json()).then(console.log) in the Console to check traffic is flowing.
Cannot install extensions (for example on a Smart TV)? Load the SDK instead: add <script src="https://proxyceptor.com/proxyceptor-sdk.js"></script> and call ProxyCeptor.init({ apiKey: "sdm_live_..." }). Rules created in the dashboard apply the same way.

Exercise 1: Inspect traffic

Open the Network tab in the ProxyCeptor panel and re-run the fetch. You will see method, URL, status, size and timing. From a row you can send the request to the Proxy tab to start a rule for that URL, or export the session as a HAR file. The Proxy tab also keeps a traffic log showing which rule acted on each request.

Exercise 2: Mock a response

Replace the whole response for user 1 with your own JSON. The request never reaches the server.

Rule: full mock
JSON
{
"name": "Mock user 1",
"match": { "urlPattern": "https://jsonplaceholder.typicode.com/users/1", "matchType": "exact" },
"response": {
"body": {
"enabled": true,
"mode": "replace-whole",
"statusCode": 200,
"value": "{ \"id\": 1, \"name\": \"Ada Lovelace\", \"email\": \"ada@example.com\" }"
}
}
}

Re-run the fetch: the console prints Ada. More detail in how to mock API responses with custom JSON.

Exercise 3: Change one field and keep the rest real (deep merge)

Full mocks go stale. A deep merge lets the real request through and patches only the keys you name. Nested objects merge recursively.

Rule: deep merge
JSON
{
"name": "User 1 lives in Paris",
"match": { "urlPattern": "*/users/1", "matchType": "wildcard" },
"response": {
"body": {
"enabled": true,
"mode": "merge-json",
"mergeValue": "{ \"address\": { \"city\": \"Paris\" } }"
}
}
}

Disable the Exercise 2 rule first. The response now has the real name and email, and only address.city has changed. See merging and appending response data.

Exercise 4: Simulate a slow 500 error

Most UI bugs hide in failure paths. This rule waits 3 seconds and then returns a 500, so you can watch your loading state and your error state in turn.

Rule: latency + error
JSON
{
"name": "Posts API is down",
"match": { "urlPattern": "*/posts*", "matchType": "wildcard" },
"response": {
"delay": 3000,
"body": {
"enabled": true,
"mode": "replace-whole",
"statusCode": 500,
"value": "{ \"error\": \"Internal Server Error\" }"
}
}
}

Try 401 (expired session), 429 (rate limit) and 504 (gateway timeout) too. See simulating HTTP error codes and the frontend API error testing checklist.

Exercise 5: Redirect an API to another environment

Point production UI at staging or localhost without rebuilding. A URL rewrite is a find-and-replace on the request URL, so /v1/orders?page=2 keeps its path and query. It is applied through Chrome's declarativeNetRequest, so it works for scripts, images and XHR alike.

Rule: rewrite host, keep path
JSON
{
"name": "Prod API to local",
"match": { "urlPattern": "https://api.example.com/*", "matchType": "wildcard" },
"request": {
"urlRewrite": { "find": "https://api.example.com", "replace": "http://localhost:3000" }
}
}

Need every match to go to one fixed URL instead? Use request.redirectUrl. See how to rewrite and redirect API URLs.

Next steps: share the rules

Everything above is a JSON rule. Export them to a file, or save them in a cloud workspace so QA, design and the rest of the team get the same mocks. On a TV, the SDK picks them up with a workspace API key. See sharing proxy rules across engineering teams.

Frequently asked questions

Do I need Burp Suite to intercept HTTP requests?

No. Burp is designed for security testing. For development and QA, a browser interceptor such as ProxyCeptor is faster and needs no certificates.

Can I pause a request and edit it by hand like Burp Intercept?

ProxyCeptor is rule-based rather than breakpoint-based: you describe the change once and it applies automatically. That is usually faster for repeated debugging. For manual one-off tampering in a security test, Burp's Intercept tab is the better fit.

Does this work for GraphQL?

Yes, GraphQL is sent over HTTP. Match the GraphQL endpoint and mock or merge the JSON response.

Written by

Arnav Khond Intern

Arnav is the intern, and the voice for anyone meeting API debugging for the first time. He writes what he wishes someone had explained on day one: plain language, small steps and the occasional meme when a status code deserves one. Expect honest questions, no gatekeeping and a lot of learning in public.

“Please be gentle. I am the intern.”

More from Arnav →

Read next

Intercept your first request in under a minute

Create a free ProxyCeptor account to mock, delay, block and rewrite API traffic, then share the same rules with your team.

🚀 Mock, delay and break API calls in ChromeTry ProxyCeptor free