Modify AJAX Response Rule

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.

Using Modify AJAX Response Rule

Navigate to your Requestly Dashboard and click on New Rule

Click "New Rule" button

Choose the Modify AJAX 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. Make sure it is less than 1500 characters.

Enter expected Response Body

If you want to modify response type or headers as well, use the Modify using JavaScript feature.

Modify using JavaScript

Save the Rule and see it working in action.