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, ∼4471🔥, 0💬
Popular Posts:
How to read Atom validation errors at w3.org? If your Atom feed has errors, the Atom validator at w3...
What is EPUB 3.0 Metadata "dc:description" Element? EPUB 3.0 Metadata "dc:description" is an optiona...
How to use the built-in "context" object in Policy expressions? The built-in "context" object can be...
What is the "__init__()" class method? The "__init__()" class method is a special method that will b...
Where to find tutorials on JSON (JavaScript Object Notation) text string format? I want to know how ...