SharePoint REST API request headerOn 2 minutes
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.
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
Option 2: minimalmetadata
accept: application/json; odata=minimalmetadata
Option 3: nometadata
accept: application/json; odata=nometadata
Option 4: Don’t provide it
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