Tools, FAQ, Tutorials:
Policy to Echo the Request Body Only
How to write a policy to echo the request body only?
✍: FYIcenter.com
Here is a policy that echoes the request body only:
<!-- Echo-Policy.xml
Copyright (c) FYIcenter.com
-->
<policies>
<inbound>
</inbound>
<backend>
</backend>
<outbound>
<return-response>
<set-status code="200" reason="Ok"/>
<set-body>@(context.Request.Body.As<string>())</set-body>
</return-response>
</outbound>
<on-error>
</on-error>
</policies>
If you specify this policy to your API operation, the client request will not be forwarded to any backend services.
Azure will return the request body as the response body with a status code of 200.
2017-10-23, ∼2891🔥, 0💬
Popular Posts:
How To Avoid the Undefined Index Error in PHP? If you don't want your PHP page to give out errors as...
Where to get the detailed description of the JSON.stringify() Function in JavaScript? Here is the de...
How To Access a Global Variable inside a Function? in PHP? By default, global variables are not acce...
What Is session_register() in PHP? session_register() is old function that registers global variable...
Why am I getting this "Docker failed to initialize" error? After installing the latest version of Do...