The Modify AJAX Response Rule allows you to mock the response body of an AJAX 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 AJAX responses but don`t have access to the back-end.
You want to mock fluctuating AJAX responses
You want to test application behaviour when provided altered data source
This rule does not support fetch()
API yet.
Navigate to your Requestly Dashboard and click on New Rule
Choose the Modify AJAX Response Rule
Enter the matching conditions to target your API. To add advance filters, click on Add Filters link on the right.
Enter the Response Body you expect. Make sure it is less than 1500 characters.
If you want to modify response type or headers as well, use the Modify using JavaScript feature.
Save the Rule and see it working in action.