'set-variable' Statement to Create Custom Variables
How to use the "set-variable" Policy Statement to create custom variables for an Azure API service operation?
The "set-variable" policy statement allows you to create custom variables with given values to be used later in other policy statements.
The "set-variable" statement has the following syntax:
<set-variable name="variable_name" value="Expression | Text" />
If a "@(...)" expression is used, the variable have hold the objects returned from the expression in a number of C# types, like System.Boolean, System.Int32, System.Single, System.Double, System.String, System.DateTime, etc.
For example, the following inbound policy creates three variables: the first one with a text as its value; the second one with a "@(...)" expression returning a Boolean; the third one with a "@(...)" expression returning a String;
<inbound> <set-variable name="version" value="1.11"/> <set-variable name="isMobile" value="@(context.Request.Headers["User-Agent"].Contains("iPad"))"/> <set-variable name="method" value="@(context.Request.Method)"/> </inbound>
For more information on "set-variable" statement, see API Management policy expressions Website.
2018-01-24, 614👍, 0💬
How to see more EPUB 2.0 metadata list with Calibre? You can follow this tutorial to view EPUB 2.0 m...
Where to find tutorials on EPUB file format? I want to know how to create EPUB books. Here is a larg...
Where to find tutorials on how to use PHP built-in functions to manage arrays? A collection of tutor...
How To Control Vertical Alignment? By default, text in all table cells are aligned to the top vertic...
How To Loop through an Array without Using "foreach" in PHP? PHP offers the following functions to a...