Skip to content

Add req.req and req.res sections #1603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
13 changes: 13 additions & 0 deletions node.js/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ this.on ('*', req => {
```

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).
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.



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



### . req {.property}

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).



### . res {.property}

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).



### . method {.property}

The HTTP method of the incoming request:
Expand Down