Suppressing SharePoint REST metadata using odata=nometadata fails #644
Labels
status:by-design
Topic described is by design & not considered an issue.
type:bug-suspected
Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Category
Expected or Desired Behavior
Originally, whenever you wanted to suppress the metadata in the JSON response of SharePoint REST APIs, you would include the
Accept: application/json;odata=nometadata
request header.Observed Behavior
If you add the
Accept: application/json;odata=nometadata
request header to a request to the SharePoint REST API, the request will fail with a 406 Not Acceptable response. Instead you have to use theAccept: application/json;odata.metadata=none
header. This has to do with the SPHttpClient using theodata-version: 4.0
request header. Without this header, or with the odata version being set to2.0
you can useodata=nometadata
to suppress metadata. In the previous versions of the SharePoint Framework you could useodata=nometadata
but in the latest version it fails. It could be that this is caused not by a change in the SharePoint Framework but in how SharePoint REST API handles thedata-version: 4.0
request header.Steps to Reproduce
The text was updated successfully, but these errors were encountered: