You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|template|Used to change the templating mode that the `set-body` policy will run in. Currently the only supported value is:<br /><br />- `liquid` - the `set-body` policy will use the liquid templating engine |No| N/A|
36
-
|xsi-nil| Used to control how elements marked with `xsi:nil="true"` are represented in XML payloads. Set to one of the following values:<br /><br />- `blank` - `nil` is represented with an empty string.<br />- `null` - `nil` is represented with a null value.|No |`blank`|
35
+
|template|Used to change the templating mode that the `set-body` policy runs in. Currently the only supported value is:<br /><br />- `liquid` - the `set-body` policy will use the liquid templating engine |No| N/A|
36
+
|xsi-nil| Used to control how elements marked with `xsi:nil="true"` are represented in XML payloads. Set to one of the following values:<br /><br />- `blank` - `nil` is represented with an empty string.<br />- `null` - `nil` is represented with a null value.<br/></br>Policy expressions aren't allowed. |No |`blank`|
37
37
38
38
For accessing information about the request and response, the Liquid template can bind to a context object with the following properties: <br />
39
39
<pre>context.
@@ -82,10 +82,10 @@ OriginalUrl.
82
82
83
83
### Usage notes
84
84
85
-
- If you are using the `set-body` policy to return a new or updated body, you don't need to set `preserveContent` to `true` because you are explicitly supplying the new body contents.
86
-
- Preserving the content of a response in the inbound pipeline doesn't make sense because there is no response yet.
85
+
- If you're using the `set-body` policy to return a new or updated body, you don't need to set `preserveContent` to `true` because you're explicitly supplying the new body contents.
86
+
- Preserving the content of a response in the inbound pipeline doesn't make sense because there's no response yet.
87
87
- Preserving the content of a request in the outbound pipeline doesn't make sense because the request has already been sent to the backend at this point.
88
-
- If this policy is used when there is no message body, for example in an inbound `GET`, an exception is thrown.
88
+
- If this policy is used when there's no message body, for example in an inbound `GET`, an exception is thrown.
89
89
90
90
For more information, see the `context.Request.Body`, `context.Response.Body`, and the `IMessageBody` sections in the [Context variable](api-management-policy-expressions.md#ContextVariables) table.
91
91
@@ -162,7 +162,7 @@ The following Liquid filters are supported in the `set-body` policy. For filter
162
162
163
163
### Accessing the body as a string
164
164
165
-
We are preserving the original request body so that we can access it later in the pipeline.
165
+
We're preserving the original request body so that we can access it later in the pipeline.
166
166
167
167
```xml
168
168
<set-body>
@@ -178,7 +178,7 @@ We are preserving the original request body so that we can access it later in th
178
178
179
179
### Accessing the body as a JObject
180
180
181
-
Since we are not reserving the original request body, accessing it later in the pipeline will result in an exception.
181
+
Since we're not reserving the original request body, accessing it later in the pipeline will result in an exception.
182
182
183
183
```xml
184
184
<set-body>
@@ -239,7 +239,7 @@ This example shows how to perform content filtering by removing data elements fr
239
239
```
240
240
241
241
### Access the body as URL-encoded form data
242
-
The following example uses the `AsFormUrlEncodedContent()` expression to access the request body as URL-encoded form data (content type `application/x-www-form-urlencoded`), and then converts it to JSON. Since we are not reserving the original request body, accessing it later in the pipeline will result in an exception.
242
+
The following example uses the `AsFormUrlEncodedContent()` expression to access the request body as URL-encoded form data (content type `application/x-www-form-urlencoded`), and then converts it to JSON. Since we're not reserving the original request body, accessing it later in the pipeline will result in an exception.
243
243
244
244
```xml
245
245
<set-body>
@@ -251,7 +251,7 @@ The following example uses the `AsFormUrlEncodedContent()` expression to access
251
251
```
252
252
253
253
### Access and return body as URL-encoded form data
254
-
The following example uses the `AsFormUrlEncodedContent()` expression to access the request body as URL-encoded form data (content type `application/x-www-form-urlencoded`), adds data to the payload, and returns URL-encoded form data. Since we are not reserving the original request body, accessing it later in the pipeline will result in an exception.
254
+
The following example uses the `AsFormUrlEncodedContent()` expression to access the request body as URL-encoded form data (content type `application/x-www-form-urlencoded`), adds data to the payload, and returns URL-encoded form data. Since we're not reserving the original request body, accessing it later in the pipeline will result in an exception.
|exists-action|Specifies action to take when the header is already specified. This attribute must have one of the following values.<br /><br /> - `override` - replaces the value of the existing header.<br />- `skip` - does not replace the existing header value.<br />- `append` - appends the value to the existing header value.<br />- `delete` - removes the header from the request.<br /><br /> When set to `override`, enlisting multiple entries with the same name results in the header being set according to all entries (which will be listed multiple times); only listed values will be set in the result.|No|`override`|
34
-
|name|Specifies name of the header to be set.|Yes|N/A|
33
+
|exists-action|Specifies action to take when the header is already specified. This attribute must have one of the following values.<br /><br /> - `override` - replaces the value of the existing header.<br />- `skip` - does not replace the existing header value.<br />- `append` - appends the value to the existing header value.<br />- `delete` - removes the header from the request.<br /><br /> When set to `override`, enlisting multiple entries with the same name results in the header being set according to all entries (which will be listed multiple times); only listed values will be set in the result. <br/><br/>Policy expressions are allowed.|No|`override`|
34
+
|name|Specifies name of the header to be set. Policy expressions are allowed.|Yes|N/A|
35
35
36
36
37
37
## Elements
38
38
39
39
|Name|Description|Required|
40
40
|----------|-----------------|--------------|
41
-
|value|Specifies the value of the header to be set. For multiple headers with the same name, add additional `value` elements.|No|
41
+
|value|Specifies the value of the header to be set. Policy expressions are allowed. For multiple headers with the same name, add additional `value` elements.|No|
|exists-action|Specifies what action to take when the query parameter is already specified. This attribute must have one of the following values.<br /><br /> - `override` - replaces the value of the existing parameter.<br />- `skip` - does not replace the existing query parameter value.<br />- `append` - appends the value to the existing query parameter value.<br />- `delete` - removes the query parameter from the request.<br /><br /> When set to `override` enlisting multiple entries with the same name results in the query parameter being set according to all entries (which will be listed multiple times); only listed values will be set in the result.|No|`override`|
33
-
|name|Specifies name of the query parameter to be set.|Yes|N/A|
32
+
|exists-action|Specifies what action to take when the query parameter is already specified. This attribute must have one of the following values.<br /><br /> - `override` - replaces the value of the existing parameter.<br />- `skip` - does not replace the existing query parameter value.<br />- `append` - appends the value to the existing query parameter value.<br />- `delete` - removes the query parameter from the request.<br /><br /> When set to `override` enlisting multiple entries with the same name results in the query parameter being set according to all entries (which will be listed multiple times); only listed values will be set in the result.<br/><br/>Policy expressions are allowed. |No|`override`|
33
+
|name|Specifies name of the query parameter to be set. Policy expressions are allowed. |Yes|N/A|
34
34
35
35
## Elements
36
36
37
37
|Name|Description|Required|
38
38
|----------|-----------------|--------------|
39
-
|value|Specifies the value of the query parameter to be set. For multiple query parameters with the same name, add additional `value` elements.|Yes|
39
+
|value|Specifies the value of the query parameter to be set. For multiple query parameters with the same name, add additional `value` elements. Policy expressions are allowed. |Yes|
| source | String literal meaningful to the trace viewer and specifying the source of the message. | Yes | N/A |
39
-
| severity | Specifies the severity level of the trace. Allowed values are `verbose`, `information`, `error` (from lowest to highest). | No |`verbose`|
38
+
| source | String literal meaningful to the trace viewer and specifying the source of the message. Policy expressions aren't allowed. | Yes | N/A |
39
+
| severity | Specifies the severity level of the trace. Allowed values are `verbose`, `information`, `error` (from lowest to highest). Policy expressions aren't allowed. | No |`verbose`|
40
40
41
41
## Elements
42
42
43
43
|Name|Description|Required|
44
44
|----------|-----------------|--------------|
45
-
| message | A string or expression to be logged. | Yes |
45
+
| message | A string or expression to be logged. Policy expressions are allowed. | Yes |
46
46
| metadata | Adds a custom property to the Application Insights [Trace](../azure-monitor/app/data-model-complete.md#trace) telemetry. | No |
0 commit comments