These destinations are pointing to the demo OData service API https://services.odata.org/v4/Northwind/Northwind.svc/ of odata.org. This API endpoint doesn't need authentication.
- Retrieve a product list from public available OData Service called Northwind - Standalone Node.js/Javascript Example
const cdsapi = require("@sapmentors/cds-scp-api");
async function InternetAPIGetRequestwithNoAuthentication() {
const service = await cdsapi.connect.to("Northwind");
// HTTP GET request based on Axios
return await service.run({
url: "/Products?$top=2",
header: {
'content-type': 'application/json'
},
transformResponse: ((data) => {
return (data)
})
})
}
InternetAPIGetRequestwithNoAuthentication()
.then((data) => {
let result = JSON.parse(data)
console.log(result.value[0].ProductName)
})
Chai