Tools, FAQ, Tutorials:
'find-and-replace' Policy Statement
How to use the "find-and-replace" Policy Statement for an Azure API service operation?
✍: FYIcenter.com
The "find-and-replace" Policy Statement allows you to find and replace a sub string in the request body or response body.
For example, the following inbound policy will replace "$id" by the template parameter "id" value in the request body:
<inbound> <find-and-replace from="$id" to="@(context.Request.MatchedParameters["id"]" /> </inbound>
The following outbound policy will replace "$key" by "xxxxxx" in the response body:
<outbound> <find-and-replace from="$key" to="xxxxxx" /> </outbound>
For some reason, the "find-and-replace" statement in the inbound policy will cause issues for some backend services. So use it only in outbound policy.
⇒ 'xml-to-json' Policy Statement
⇐ Policy to Modify Request and Response Body
2018-01-19, 4783🔥, 0💬
Popular Posts:
Where to find tutorials on Python programming language? I want to learn Python. Here is a large coll...
Why I am getting "The Windows SDK version 8.1 was not found" error, when building my C++ application...
Where to get a JSON.stringify() Example Code in JavaScript? Here is a good JSON.stringify() example ...
How to use the "@(...)" expression in Azure API Policy? The "@(...)" expression in Azure API Policy ...
How To Avoid the Undefined Index Error in PHP? If you don't want your PHP page to give out errors as...