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|
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
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 />
@@ -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.
0 commit comments