Serving default responses when no specific match is found
403 Unauthorized
response with a meaningful response body when a request is not matched rather than the default 404. Additionally you
want to serve 200 response when a GET
request is made to /examples/12
.
Start by creating a stub with ANY
as the method. Open the Advanced section and change the URL match type to Any URL
.
Also in the Advanced section set the Priority to 10 (the lowest).
403
and the body content to "Sorry, you can't do that"
.
GET
, the URL to /examples/12
and the response body to "Example 12 body"
(keeping the Status as 200
).
Now if you make a request that matches the specific stub you will see a response with a 200
status and the success message:
403
response.