I need the following URL to return JSON: https://mysite/_vti_bin/listdata.svc/Pages
I've tried added the following to the URL (per a blog online but didn't work): https://mysite/_vti_bin/listdata.svc/Pages?format=JSON
It always returns XML. Also, I'm not calling the web service via C# or JS code. I'm using a rapid app dev platform that has built-in API consumption. All I need is JSON to be returned (given a URL structure) and I got what I need. Thanks.
By default SharePoint 2010 REST service returns results in XML format. To get the results in JSON format, include an Accept
header set to application/json;odata=verbose
.
Example
url: http://site url/_vti_bin/listdata.svc/ListName,
method: GET
Headers:
accept: "application/json;odata=verbose"
Result
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With