The Mock interceptor enables the user to create a default response to be displayed whenever the API is invoked.
When you insert the Mock interceptor into your API flow, the following pieces of information may be entered:
quantity_requests = 20, with the delimiter being = or :.
In case you need to insert more than one header in your Mock, you may do so by placing one value per line.The image below displays the screen with all data filled out.

This interceptor may only be added in the request flow.
IMPORTANTExample
Imagine that you are testing a code and a given API has not been implemented on the back-end side yet. You may add the Mock interceptor to your API flow and it will simulate the backend response, returning whatever you configure it to do.
Interceptors are executed in the order they appear in the flow, and the flow is always executed until the end. The difference is that the request will not be forwarded to the destination.
WARNINGThe Mock interceptor will not interrupt the flow. All interceptors will run as expected, even if they are positioned after the Mock interceptor.
To set up a simulation that performs in a way that is closer to reality, place the Mock interceptor last, as shown in the image below. To change the order of the interceptors just drag and drop the interceptor to the desired position.

NOTEIf there is a Log interceptor after the Mock interceptor, it is necessary to add the
Content-Typeheader with the valuetext/*orapplication/jsonfor a better view of the details. If the values cited are not informed, the data returned by the Mock interceptor will be encrypted and displayed in Base64.
We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more