Skip to content

Commit e76533e

Browse files
authored
some changes
1 parent b630e35 commit e76533e

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

support/power-platform/dataverse/dataverse-web-api-and-sdk/web-api-client-errors.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Troubleshoot Web API client errors
33
description: Provides resolutions for the common client errors that occur when you use the Dataverse Web API.
4-
ms.date: 06/12/2024
4+
ms.date: 01/23/2024
55
ms.custom: sap:Dataverse Web API and SDK\Odata endpoint errors
66
author: divkamath
77
ms.author: dikamath
@@ -113,7 +113,7 @@ HTTP/1.1 404 Not Found
113113

114114
### Cause
115115

116-
This error occurs when the incorrect HTTP method is applied to a function or action. In this case, [WhoAmI Function](xref:Microsoft.Dynamics.CRM.WhoAmI) requires the use of `GET` but `POST` was used.
116+
This error occurs when the incorrect HTTP method is applied to a function or action. In this case, the [WhoAmI function](xref:Microsoft.Dynamics.CRM.WhoAmI) requires the use of `GET` but `POST` was used.
117117

118118
### How to avoid
119119

@@ -271,13 +271,11 @@ In this case, just adding a carriage return at the end of the last line is enoug
271271

272272
Ensure all line endings in the `$batch` request body are `CRLF`. If you can't use `CRLF`, add two non-`CRLF` line endings at the end of the batch request body to resolve this deserialization error. For more information, see [Batch requests](/power-apps/developer/data-platform/webapi/execute-batch-operations-using-web-api#batch-requests).
273273

274-
## Invalid OData Annotation values inside Prefer request header value
275-
276-
These errors occur when Dataverse Web API receives requests with an invalid `odata.include-annotations` value inside the `Prefer` request header values.
274+
## Error identified on the 'odata.include-annotations' value inside the 'Prefer' header
277275

278276
### Symptoms
279277

280-
This error occurs when you send a request using `POST`, `PATCH`, or `PUT` Http methods and a `Prefer` request header that contains an invalid value. In the following example, the `odata.include-annotations` value is incorrectly including back slashes '`\`' to escape the quote characters.
278+
The error occurs when the [Dataverse Web API](/power-apps/developer/data-platform/webapi/overview) receives a request with an invalid `odata.include-annotations` value in the `Prefer` request header value. This issue occurs when the request is sent using the `POST`, `PATCH`, `PUT` or `GET` HTTP methods with a `Prefer` request header that contains an invalid or improperly formatted value. For example, the `odata.include-annotations` value incorrectly includes backslashes '`\`' to escape the quote characters.
281279

282280
**Request**
283281

@@ -290,11 +288,8 @@ Prefer: odata.include-annotations=\"*\"
290288
"firstname":"test",
291289
"lastname":"contact"
292290
}
293-
294291
```
295292

296-
You get the following error when you submit a `POST`, `PATCH`, or `PUT` request.
297-
298293
**Response**
299294

300295
```http
@@ -306,18 +301,15 @@ HTTP/1.1 400 Bad Request
306301
See exception message for more details 'An error occurred when parsing the HTTP header 'Prefer'. The header value 'odata.include-annotations=\\\"*\\\"' is incorrect at position '26' because the escape character '\\' is not inside a quoted-string.'.",
307302
"ErrorCode": "0x80097303"
308303
}
309-
310304
```
311305

312-
You get the same error when sending a request using `GET` with an improperly formatted `odata.include-annotations` value.
313-
314306
### Cause
315307

316-
To provide a more secure service, we fixed an issue that allowed invalid `Prefer` request header values to be processed when using `POST`, `PATCH`, or `PUT` without being validated first. Now, validation occurs regardless of the HTTP method. This error will occur starting with Dataverse version `9.2.2412.3` which began deployment in January of 2025 and will be deployed to all regions in February of 2025.
308+
To provide a more secure service, we have fixed an issue where invalid `Prefer` request header values were processed without validation when using the `POST`, `PATCH`, or `PUT` HTTP methods. Now, validation is enforced for all HTTP methods. This error will occur starting with Dataverse version 9.2.2412.3 that began deployment in January 2025 and will be deployed to all regions by February 2025.
317309

318310
### How to avoid
319311

320-
Review the guidance about how to properly set [Prefer Headers in the Dataverse Web API documentation](/power-apps/developer/data-platform/webapi/compose-http-requests-handle-errors#prefer-headers).
312+
Review the guidance about how to properly set [Prefer headers in the Dataverse Web API](/power-apps/developer/data-platform/webapi/compose-http-requests-handle-errors#prefer-headers).
321313

322314
## See also
323315

0 commit comments

Comments
 (0)