Tools, FAQ, Tutorials:
'choose ... when ...' Statements to Control Execution Flows
How to use 'choose ... when ..." policy statements to control execution flows?
✍: FYIcenter.com
If you want to control execution flows in Azure API management process, you can use the 'choose ... when ..." policy statement.
The "choose ... when ..." statement has the following syntax:
<choose> <when condition="Boolean_expression"> ... </when> <when condition="Boolean_expression"> ... </when> <otherwise> ... </otherwise> </choose>
For example,
<choose> <when condition="@(context.Variables.GetValueOrDefault<bool>("isMobile"))"> <set-query-parameter name="mobile" exists-action="override"> <value>true</value> </set-query-parameter> </when> <otherwise> <set-query-parameter name="mobile" exists-action="override"> <value>false</value> </set-query-parameter> </otherwise> </choose>
⇒ Policy to Modify Request and Response Body
2018-01-19, 2872🔥, 0💬
Popular Posts:
How To Get the Minimum or Maximum Value of an Array in PHP? If you want to get the minimum or maximu...
How to use the "set-variable" Policy Statement to create custom variables for an Azure API service o...
Why I am getting "The Windows SDK version 8.1 was not found" error, when building my C++ application...
What are the differences of Differences of evaluateTransaction() and submitTransaction() of the fabr...
How to run CMD Commands in Dockerfile to change Windows Docker images? When building a new Windows i...