Create Mock Rule
Click on Reset / New + to start creating a new mock response rule.
After configuring the following parameters hit save.
Parameters
Regex toggle
Use this button to toggle regex based url matching.
URL
Enter the URL of the request that you want to mock. You can specify the exact URL or use regular expressions for pattern matching.
Url with regex
Absolute url without regex matching
Method
Select the HTTP method (GET, POST, PUT, DELETE, etc.) of the request. Default is GET.
Status Code
Specify the HTTP status code to be returned in the mock response. Default will be 200 (OK)
Delay
Specify the delay (in milliseconds) before the mock response is sent. This parameter is optional. Defaults to 0.
Label
Provide a label or identifier for the mock response. This parameter is optional. This will come in handy if you have multiple requests with same url but with different responses. Specify different labels and activate / deactivate accordingly.
Specify label from here.
Label will be visible in rules list like this:
Response Body
Enter the desired response content in JSON format or raw text.
Response Headers
- Click on the Resp Headers tab to configure Response headers.
- Add, edit and remove response headers here.
- Headers can be activated / deactivated based on use case.