Table of Content
- What is stub response?
- Use cases
- Adding a stub response
- Disable / enable stub response
- Remove a stub response
What is stub response?
Stub response allows you to mock an HTTP response without hitting the actual server.
- Stub a slow or costly backend request to speed up UI development
- Develop against an API where the implementation is not yet ready
- Simulate different status codes to test error handling
Adding a stub response
- Click on the at the top and select Stub response.
- Enter the URL that you would like to stub.
- (optional) If you would like to use regex for URL matching, click on the button and enter the regex URL expression in the text field.
- Click on the Edit response button and enter the stub response status code, body, and headers.
- Click Save when you are done.
Disable / enable stub response
- To disable a stub response action, simply uncheck the checkbox on the left side of the row.
- To reenable, simply check the checkbox again.
Remove a stub response
- Simply click on the X button on the right side of the row to delete.