By default, SharePoint 2013 REST API returns output as Atom XML and there is no option to return data as JSON unless appropriate headers as passed with the request.
Usually, if you append your query with $format=json, the output would be converted into JSON in normal REST APIs. But this is not supported in SharePoint 2013 REST API and thus it rules out the possibility of viewing the data as JSON while you directly access the REST API in browser.
JQuery Ajax Request
The alternative would be perform an ajax request with passing “application/json” as “Accept” header. This would involve some JavaScript coding and jQuery request to perform the operation. Check out the “Knockout Js and (jQuery request)” topic in this blog post to learn more on how to perform this request. This article also discusses other possible options to perform the same operation with the help of jQuery
Rest Calls without jQuery
If you wish to just view the content as JSON from SharePoint REST API, then the easiest alternative would be to use Advanced REST Client Extension for Chrome. This extension allows you to perform all kinds of REST calls and also provided provision to and headers to REST Calls. To know more about other JSON tools for SharePoint, check this blog post
Leave a comment