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, 1933👍, 0💬
Popular Posts:
How to view API details on the Publisher Dashboard of an Azure API Management Service? You can follo...
How to write a policy to set and get custom variables? Here is a policy that sets and gets custom va...
How to use the XML to JSON Conversion Tool at freeformatter.com? If you want to try the XML to JSON ...
What Is Azure API Management Service? Azure API Management as a turnkey solution for publishing APIs...
Where Is the Submitted Form Data Stored in PHP? When a user submit a form on your Web server, user e...