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, 1111👍, 0💬
Popular Posts:
How To Support Multiple-Page Forms in PHP? If you have a long form with a lots of fields, you may wa...
How to create Hello-3.1.epub with WinRAR? I have all required files to create Hello-3.1.epub. To cre...
How to access URL template parameters from "context.Request.Matched Parameters"object in Azure API P...
How to use the "send-request" Policy statement to call an extra web service for an Azure API service...
What's Wrong with "while ($c=fgetc($f)) {}" in PHP? If you are using "while ($c=fgetc($f)) {}" to lo...