Tools, FAQ, Tutorials:
'mock-response' Policy Statement
How to use the "mock-response" Policy statement to return an example response for an Azure API service operation?
✍: FYIcenter.com
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>
⇒ 'return-response' Policy Statement
2018-01-16, 1720🔥, 0💬
Popular Posts:
What Is Azure API Management Service? Azure API Management as a turnkey solution for publishing APIs...
How to use the "@(...)" expression in Azure API Policy? The "@(...)" expression in Azure API Policy ...
What validation keywords I can use in JSON Schema to specifically validate JSON Array values? The cu...
How to use "xsl-transform" Azure API Policy Statement? The "xsl-transform" Policy Statement allows y...
How to extend json.JSONEncoder class? I want to encode other Python data types to JSON. If you encod...