OData Cheat Sheet (CAP)

Aus MattWiki

This article holds notes on how to quickly get certain responses from a OData service, specifically from an SAP Cloud Application Programming Model (CAP) OData service.

Sources:

https://www.odata.org/getting-started/basic-tutorial/


OData V4

Querying Data

GET serviceRoot/People?$count=true

Returns the number of records retreived


OData Service Request Contents

Below are contents of request req from actions listed

Object Response Comment
req.target bookshop_Books returns req.target.name
req.params (1) ['3b1e1d9e-9563-4cd3-a448-69b8b8f1c384'] returns an array of length 1
req.params[0] '3b1e1d9e-9563-4cd3-a448-69b8b8f1c384' returns first element of the params array