Skip to content

Commit

Permalink
Add missing parameters in srv.send
Browse files Browse the repository at this point in the history
  • Loading branch information
mariayord committed Jan 17, 2024
1 parent 6c668e1 commit fba003a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion node.js/core-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ Error handlers are invoked whenever an error occurs during event processing of *

```ts
async function srv.send (
method : string | { method, path?, data?, headers? },
method : string | { method, path?, data?, headers? } | { query, headers? },
path? : string,
data? : object | any,
headers? : object
Expand Down Expand Up @@ -812,6 +812,10 @@ let req = new cds.Request (
)
return this.dispatch(req)
```
Use this method instead of [`srv.run(query)`](#srv-run-query), if headers should be added to the request object. For example:
```js
await srv.send({ query: SELECT.from('Books'), headers: { some: 'header' } })
```

*See also [REST-Style Convenience API](#rest-style-api) below* {.learn-more}

Expand Down

0 comments on commit fba003a

Please sign in to comment.