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, 1630🔥, 0💬
Popular Posts:
How to use "json-to-xml" Azure API Policy Statement? The "json-to-xml" Policy Statement allows you t...
How To Loop through an Array without Using "foreach" in PHP? PHP offers the following functions to a...
How to add a new operation to an API on the Publisher Dashboard of an Azure API Management Service? ...
How To Use an Array as a Queue in PHP? A queue is a simple data structure that manages data elements...
How to attach console to a Running Container using the "docker container exec" command? I want to ge...