I am working on MS SharePoint 2013 integration and in my use case I want to work on JSON data only.
I am able to convert all the API XML responses like File, Folder, List, ListItem, etc into OData JSON using Node Module - datajs_vanilla, but I am not able to convert https://mysite/_api/$metadata into OData JSON.
I am getting below error while executing datajs for $metadata endpoint:
error:{"message":"no handler for data"}
Below is my code snippet:
OData.read({
requestUri: 'https://example.com/_api/$metadata',
headers: {
'Authorization': 'Bearer token_value',
'Accept':'application/xml;charset=utf-8'
}
}, function (data, response) {
console.log("Operation succeeded."+JSON.stringify(data));
}, function (err) {
console.log("Error occurred " + JSON.stringify(err));
});
I am missing something here to convert into JSON?
or
Could you please suggest me possible solution to convert edmx sharepoint $metadata XML response into OData JSON using node module?
Thanks.