'mock-response' Policy Statement
How to use the "mock-response" Policy statement to return an example response for an Azure API service operation?
The "mock-response" Policy Statement allows you to return a fake response and stop the Azure API processing immediately.
The "mock-response" Statement has the following syntax:
<mock-response status-code="code (default 200)" content-type="media type"/>
For example, the following inbound policy returns a response with status code 200 and the first body example under status 200 defined in the API operation:
<inbound> ... <mock-response/> </inbound>
The following inbound policy returns a response with status code 202 and the body example of "application/json" type under status 201 defined in the API operation:
<inbound> ... <mock-response status-code='201' content-type='application/json'/> </inbound>
2018-01-16, 572👍, 0💬
How to use the "send-request" Policy statement to call an extra web service for an Azure API service...
FYIcenter.com Online Tools: FYIcenter JSON Validator and Formatter FYIcenter JSON to XML Converter F...
How to add request URL Template Parameters to my Azure API operation to make it more user friendly? ...
How to write a policy to set and get custom variables? Here is a policy that sets and gets custom va...
How To Quote Date and Time Values in SQL Statements in PHP? If you want to provide date and time val...