How to Rewrite REST API Responses in Production-Like Testing
ProxyCeptor allows developers to rewrite REST API responses in production-like testing environments using recursive JSON Deep Merge and dynamic JavaScript transforms (execute-js). Instead of replacing huge payloads with static stubs, developers supply only the specific JSON keys to modify. ProxyCeptor intercepts the real upstream response and merges the updates seamlessly in memory.
The Core Challenge & Workflow
Full API response mocking often creates fragile tests because developers must maintain entire JSON structures with dozens of nested fields. When production APIs evolve, full stubs break. ProxyCeptor's JSON Deep Merge solves this by altering only the target keys while keeping all other production response data live.
Key Capabilities & Features
Recursive JSON Deep Merge
Target specific nested keys (e.g. `{"user": {"features": {"beta_access": true}}}`) without wiping out other customer profile data.
Dynamic JavaScript Transform (`execute-js`)
Write arbitrary JS functions that receive the live upstream status, headers, and body, and return mutated data conditionally.
Header & Status Code Mutation
Rewrite HTTP response headers (`Content-Type`, `Set-Cookie`, `Access-Control-Allow-Origin`) and modify HTTP status codes in flight.
Beacon & Streaming Telemetry Inspection
Inspect and rewrite `sendBeacon` analytics and HLS/DASH video streaming manifest URLs.
Feature Comparison: ProxyCeptor vs Rivals
| Feature | ProxyCeptor | Requestly | WireMock | Mockoon | Charles |
|---|---|---|---|---|---|
| JSON Deep Merge | Yes (Recursive Native) | Limited (Full Replace) | No (Static Stub) | No (Static Stub) | No (Manual Edit) |
| Dynamic JavaScript Transforms | Yes (execute-js) | Yes (JS Rule) | Yes (Java Extensions) | Limited | No |
| Preserve Production Context | Yes (Only modifies delta) | Partial | No | No | No |
| Live Response Modification | Yes | Yes | No (Pre-canned) | No (Pre-canned) | Yes (Breakpoints) |
Step-by-Step Implementation Guide
Select Response Modify Action
Create a rule and choose "Modify Response Body" -> "JSON Deep Merge".
Specify Matching Request URL
Enter your API endpoint URL pattern (e.g., `https://api.myapp.com/v1/subscription`).
Define Delta Payload
Enter only the specific JSON fields you wish to mutate (e.g. `{"tier": "vip", "expiresAt": 1893456000}`).
Inspect Live Result
The application executes against real live production servers, but the target fields are modified in real time.
Rule Configuration JSON
{ "id": "rule_deep_merge_entitlements", "name": "Upgrade User to VIP Entitlement", "pattern": "https://api.myapp.com/v1/user/entitlements*", "action": "modify-body", "modifyType": "merge", "mergePayload": { "entitlements": { "plan": "vip_all_access", "maxStreams": 5, "adFree": true } }, "enabled": true}Frequently Asked Questions
Try This Solution Live in ProxyCeptor
Intercept, mock, delay, or merge API traffic inside your browser or Smart TV application in less than 60 seconds with zero SSL certificates.