Skip to content

Commit 41ecff7

Browse files
schwmasmahati
andauthored
Add req.req and req.res sections (#1603)
closes `cdsnode/issues/2044` --------- Co-authored-by: Mahati Shankar <m.shankar@sap.com>
1 parent f8fd9e5 commit 41ecff7

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

node.js/events.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ this.on ('*', req => {
8888
```
8989

9090
Keep in mind that multiple requests (that is, instances of `cds.Request`) may share the same incoming HTTP request and outgoing HTTP response (for example, in case of an OData batch request).
91+
See sections [`req`](#req) and [`res`](#res) of `cds.Request` to learn more about accessing the request and response objects of individual requests within an incoming batch request.
9192

9293

9394

@@ -251,6 +252,18 @@ Class `cds.Request` extends [`cds.Event`] with additional features to represent
251252

252253

253254

255+
### . req {.property}
256+
257+
Provides access to the express request object of individual requests within an incoming batch request. For convenience, in the case of non-batch requests, it points to the same request object as [`req.http.req`](#http).
258+
259+
260+
261+
### . res {.property}
262+
263+
Provides access to the express response object of individual requests within an incoming batch request. For convenience, in the case of non-batch requests, it points to the same response object as [`req.http.res`](#http).
264+
265+
266+
254267
### . method {.property}
255268

256269
The HTTP method of the incoming request:

0 commit comments

Comments
 (0)