Skip to content

Instantly share code, notes, and snippets.

@ankur0101
Created January 20, 2025 08:34
Show Gist options
  • Save ankur0101/83a15a934c303ea631f7105043d9526b to your computer and use it in GitHub Desktop.
Save ankur0101/83a15a934c303ea631f7105043d9526b to your computer and use it in GitHub Desktop.
SAP CAP - Calling function internally with headers
const oFuncResponse = await myService.myFunc1({
param1 : 'value1',
param2 : 'value2'
});
//If it is required to pass any custom headers, then use .send method with event paraeter as below:
const oFuncResponse = await myService.send({
"event": 'myFunc1',
"data": {
param1 : 'value1',
param2 : 'value2'
},
"headers": {
'x-header-foo': 'bar'
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment