Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

odata verbose or nometadata to fetch data

$
0
0

Hi,

What is the difference between verbose and nometadata in the odata definition for javascript client object model.

I tried the below code:

 headers: {    "accept": "application/json;odata=verbose","content-type":"application/json;odata=verbose","X-RequestDigest": $("#__REQUESTDIGEST").val()  },
	 success: function (data) {

		var items = data.d.results;

In the console , i can see the results. However, using the below code:

 headers: {    "accept": "application/json;odata=nometadata","content-type":"application/json;odata=nometadata","X-RequestDigest": $("#__REQUESTDIGEST").val()  },
	 success: function (data) {
	 	var items = data.d.results;

is showing error "Unable to get property 'results' of undefined or null reference".

How to use "nometadata" option and what is the major difference in using this?

Thanks


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>