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, ∼6518🔥, 0💬
Popular Posts:
How to send an FTP request with the urllib.request.urlopen() function? If an FTP server supports ano...
How To Read a File in Binary Mode in PHP? If you have a file that stores binary data, like an execut...
How to read Atom validation errors at w3.org? If your Atom feed has errors, the Atom validator at w3...
Why am I getting this "Docker failed to initialize" error? After installing the latest version of Do...
Where to get the detailed description of the json_encode() Function in PHP? Here is the detailed des...