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, ∼2132🔥, 0💬
Popular Posts:
Where to find tutorials on OpenID? Here is a large collection of tutorials to answer many frequently...
How to register and get an application ID from Azure AD? The first step to use Azure AD is to regist...
How to use the XML to JSON Conversion Tool at freeformatter.com? If you want to try the XML to JSON ...
How to use .NET CLR Types in Azure API Policy? By default, Azure imports many basic .NET CLR (Common...
How To Read a File in Binary Mode in PHP? If you have a file that stores binary data, like an execut...