SharePoint REST API request header
On
Working with the SharePoint REST API is now the norm. It makes it easier for us to work with SharePoint sites and lists/libraries. One of the drawback of the SharePoint API is the size of the payload that is returned. Not the actual data size, but the amount of meta data that accompanies it.
Update
This article is for OData V3. The corresponding version for OData v4 is in the table below:
OData V3 | OData V4 |
accept: application/json;odata=verbose | accept: application/json;odata.metadata=full |
accept: application/json;odata=minimalmetadata | accept: application/json; odata.metadata=minimal |
accept: application/json;odata=nometadata | accept: application/json; odata.metadata=none |
SharePoint online and SharePoint 2016 now supports JSON Light. JSON Light is an open standard that allows developers to provide in the header of the request how much metadata is returned. You can check out the spec from Microsoft OData JSON spec document
The usual way to call the SharePoint REST API was to include in the header request: accept: application/json; odata=verbose
. The good news is that, this header is now optional, and more OData options have been added.
Now you can significantly reduce the payload of your calls using one of these other options.
Option 1: verbose
accept: application/json; odata=verbose
The example data returned is 46,647 bytes

Option 2: minimalmetadata
accept: application/json; odata=minimalmetadata
The example data returned is 11,173 bytes


value
is json object or array depending on rest query containing values
Option 3: nometadata
accept: application/json; odata=nometadata
The nometadata option reduces the size of the payload significantly, and for many scenarios this is all that you need when working with list items. The example data returned is 6,832 bytes


value
is json object or array depending on rest query containing values
Option 4: Don’t provide it
accept: application/json
It is no longer necessary to provide the OData property in the request header, unless you would like to specify one of the values above. This defaults to minimalmetadata
option.