From jQuery-ajax to breeze.js (SharePoint ODATA example)

I am starting to use breeze.js for my ODATA service.

I am using the SharePoint ODATA api and I have an example of how to use it with jQuery-Ajax. It would be so great to do this work with breezes. Can someone help me translate this jQuery-Ajax call into breeze.js ? ... or push me in the right direction?

$.ajax({ url: "../_api/SP.WebProxy.invoke", type: "POST", data: JSON.stringify({ "requestInfo": { "__metadata": { "type": "SP.WebRequestInfo" }, "Url": "http://get_my_data_from_this_url", "Method": "GET", "Headers": { "results": [{ "__metadata": { "type": "SP.KeyValue" }, "Key": "Accept", "Value": "application/json;odata=verbose", "ValueType": "Edm.String" }] } } }), headers: { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "X-RequestDigest": $("#__REQUESTDIGEST").val() }, success: successHandler, error: errorHandler }); 

Here you can see the ODATA call for SharePoint WebProxy. Optimal feature for handling cross domain calls!

I think the question is at this point: can I build a data object using breeze.js?

+1
source share
2 answers

_ / api is the endpoint of OData v3. AFAIK neither Breeze nor JayData do not currently support this. To do something else, _api / $ metadata is not implemented in SP2013. Without a metadata document, there is no way to automatically create the required data model.

+1
source

Starting with Breeze 1.4.4, Breeze now supports OData v3.

0
source

All Articles