From fba003abe383c86f81d383975a97f8aeabc103f6 Mon Sep 17 00:00:00 2001 From: Mariya Yordanova Date: Wed, 17 Jan 2024 11:54:17 +0100 Subject: [PATCH] Add missing parameters in `srv.send` --- node.js/core-services.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/node.js/core-services.md b/node.js/core-services.md index 924e37017..38d79368f 100644 --- a/node.js/core-services.md +++ b/node.js/core-services.md @@ -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 @@ -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}