Modify Response Rule
The Modify Response Rule allows you to mock the response body of an HTTP request.
Some possible use cases of this rule includes:
  • You want to work on front-end while back-end is not available or ready yet
  • You want to modify API responses but don't have access to the back-end.
  • You want to mock fluctuating API responses
  • You want to test application behaviour when provided altered data source
fetch() API is supported in Chrome, MS Edge. For Safari & Firefox, you can use our desktop app.

Using Modify Response Rule

Navigate to your Requestly Dashboard and click on New Rule
Click "New Rule" button
Choose the Modify Response Rule
Choose Modify Response Rule
Enter the matching conditions to target your API. To add advance filters, click on Add Filters link on the right.
Specify matching conditions
Enter the Response Body you expect.
Enter expected Response Body
If you want to modify using existing/original response, use the modify using javascript feature.
Modify using JavaScript
Save the Rule and see it working in action.
When you change the rule, please refresh the page on which you want to test your AJAX response modification
You can also use the Request Payload filter as well as other source filters to get more control over which requests are being targeted by the rule
See modify response - FAQs for more information on using this rule.