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, ∼7441🔥, 0💬
Popular Posts:
How to add request URL Template Parameters to my Azure API operation to make it more user friendly? ...
How to convert a JSON text string to an XML document with PHP language? Currently, there is no built...
How to validate the id_token signature received from Azure AD v2.0 authentication response? You can ...
How to attach console to a Running Container using the "docker container exec" command? I want to ge...
How to convert JSON Objects to PHP Associative Arrays using the json_decode() function? Actually, JS...