HTTP Status Codes, Explained by an Intern (With Memes)
You will send this to a friend.
I had to learn these the hard way. Here is the version I wish I had: what each code means, one joke each, and what your UI should do about it.
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.
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.
fetch("https://jsonplaceholder.typicode.com/users/1").then(r => r.json()).then(console.log) in the Console to check traffic is flowing.<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.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.
Replace the whole response for user 1 with your own JSON. The request never reaches the server.
{ "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.
Full mocks go stale. A deep merge lets the real request through and patches only the keys you name. Nested objects merge recursively.
{ "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.
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.
{ "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.
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.
{ "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.
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.
No. Burp is designed for security testing. For development and QA, a browser interceptor such as ProxyCeptor is faster and needs no certificates.
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.
Yes, GraphQL is sent over HTTP. Match the GraphQL endpoint and mock or merge the JSON response.
You will send this to a friend.
I had to learn these the hard way. Here is the version I wish I had: what each code means, one joke each, and what your UI should do about it.
Zero to first request.
I asked what a proxy was. Now I am writing about it. Here are the mistakes that cost me the most time, so they do not cost you yours.
Create a free ProxyCeptor account to mock, delay, block and rewrite API traffic, then share the same rules with your team.