Can anyone explain why is it that when I make a REST call to retrieve items from a custom list, sometimes the items array is grouped under "d/results" path and sometimes "value" path. The results are coming from the same custom results, but I am not able to put finger on what could be causing different behaviors. Any clarifications will be appreciated.
1 Answer
I think I got it. The ACCEPT header parameter "odata = verbose" makes all the difference. Using it returns the "d/results" path. Not using it returns "value" path. I understand that there is no need to add it any more with new specs.
Further details here:
https://www.microsoft.com/en-us/microsoft-365/blog/2014/08/13/json-light-support-rest-sharepoint-api-released/
Edit: Also I noticed that if the call is made in SP 2010 style (_vti_bin/ListData.svc), then the result will be returned as "d/results" path regardless or not we use the "odata=verbose" paramater. I guess the "value" path is returned only when making the 2013 style calls (_api/web) and not using the verbose option or not using odata at all.
-
1
-
1And don't count on a default value... I suggest to always specify the odata header you want Commented Jun 15, 2016 at 14:26