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, ∼6453🔥, 0💬
Popular Posts:
How to login to the Developer Portal internally by you as the publisher? Normally, the Developer Por...
What is the Azure AD v1.0 OpenID Metadata Document? Azure AD v1.0 OpenID Metadata Document is an onl...
How to use the XML to JSON Conversion Tool at freeformatter.com? If you want to try the XML to JSON ...
Where can I download the EPUB 2.0 sample book "The Problems of Philosophy" by Lewis Theme? You can f...
How to build a test service operation to dump everything from the "context.Request" object in the re...