Skip to content
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

Add req.req and req.res sections #1603

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
21 changes: 21 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,26 @@ 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.

::: warning Note:
If the [new OData adapter](../releases/archive/2024/jun24#new-protocol-adapters-ga) isn't used, both `.req` and [`.http.req`](#http) refer to the same request object of the incoming batch request.
:::



### . res {.property}

Provides access to the express response object of individual requests within an incoming batch request.

::: warning Note:
If the [new OData adapter](../releases/archive/2024/jun24#new-protocol-adapters-ga) isn't used, both `.res` and [`.http.res`](#http) refer to the same response object of the incoming batch request.
:::



### . method {.property}

The HTTP method of the incoming request:
Expand Down