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, ∼2296🔥, 0💬
Popular Posts:
How To Read Data from Keyboard (Standard Input) in PHP? If you want to read data from the standard i...
How To Pass Arrays By References? in PHP? Like normal variables, you can pass an array by reference ...
How to use the JSON to XML Conversion Tool at utilities-online.info? If you want to try the JSON to ...
How To Read the Entire File into a Single String in PHP? If you have a file, and you want to read th...
What is EPUB 3.0 Metadata "dc:description" Element? EPUB 3.0 Metadata "dc:description" is an optiona...