janhommes / o.js

o.js - client side oData lib.
https://janhommes.github.io/o.js/example/
MIT License
241 stars 58 forks source link

o.js returns just the "value" portion of the response payload? missing response headers too #56

Closed be236 closed 7 years ago

be236 commented 7 years ago

In the example code , it talks about the response payload in result variable, like so:

console.log(result);

However, when I make a curl call directly, I get items outside of "value," as shown: ...

{ "@odata.context": "https://localhost//odata/$metadata#tm/something/", "@odata.nextLink": "https://localhost/odata/tm/something/?$skip=50&$top=50", "value": [ { "@odata.etag": "1", "@odata.id": "https://localhost/odata/tm/something('ABC1)", "description_field1": true, ... etc...

Basically o.js returns me the "value" portion of the payload, but I need to get the items outside of that "value" portion as well (eg, the context and nextLink fields)... How can I get those back from o.js?

Also, how can I get the RESPONSE HEADERs back from o.js get() call too?

janhommes commented 7 years ago

see #24. We need improvement here but you can use .raw to access the data.