Hi all why does data normall webapi return data in an ajax call where as odata returns data.d.results in ajax call..what is the difference between them
normall webapi call using ajax
$.ajax({
url: url,
jsonp: '$callback',
dataType: 'jsonp',
success: function (data) {
//data is returned as data when an webapi is called
PreReqisites.varResult = data;
}
});
but when an odata service is called
$.ajax({
url: url,
jsonp: '$callback',
dataType: 'jsonp',
success: function (data) {
//data is returned as data.d.results when an webapi is called
PreReqisites.varResult = data.d.results;
}
});
why is that data returned in these ways in odata in webapi can any one tell me pros and cons of it