In Express.js, req.res holds a reference to the response object for the same HTTP cycle. In any route or middleware handler, req.res === res is true — they are the same object, not a copy.
Express sets this link so internals (and your code) can reach the response from req alone. Day to day, prefer the res argument for clarity. See the full request and response objects for related APIs.
Syntax
Read req.res in your Express.js route handler. Start with this line.
Express
req.res // → Response (same as res)
req.res === res // → true
res.req // → Request (reverse link)
Call
What it does
req.res // → Response (same as res)
Primary signature.
req.res === res // → true
Related call form.
res.req // → Request (reverse link)
Related call form.
Install with npm install express. Create the app with const app = express() before you use this API in an Express.js tutorial project.
GET /admin (no x-user)
→ 403 { "error": "Forbidden" }
GET /admin (header x-user: admin)
→ 200 { "area": "admin" }
How It Works
Helper signature.denyIfGuest(req) only takes the request.
Reach the response.req.res.status(403).json(…) uses the linked response.
Stop the route. Returning false lets the caller return early and avoid a double send.
Alternative. Passing (req, res) into the helper is often clearer and easier to test — use that when you can.
Compatibility
Runtime Support
req.res is an Express.js request property. It runs on a Node.js server (Express 5 needs Node.js 18+). Browsers do not have this API.
✓ Server · Express 4 & 5
req.res
Works wherever Express runs: Node.js is the primary target. Bun and Deno can run many Express apps with compatibility layers. Not available in the browser.
ServerNode.js runtime API
Node.js18+ for Express 5 · 14+ typical for Express 4
Supported
BunExpress-compatible server apps
Supported
DenoVia npm compatibility / adapters
Supported
req.resExpress on Node.js
Bottom line: Study and run these examples with Node.js and the express package. Copy a snippet into a local file and start the server with node.
Frequently Asked Questions
It is a property on the request object that holds a reference to the response object for the same HTTP cycle. In a handler, req.res === res is true.
Prefer the res argument in routes and middleware — it is clearer. Use req.res when you only have the request object (for example inside a helper that receives req).
res.req points back to the request. Together they form a two-way link Express sets up for each request.
No. It is the same response instance as the res parameter — not a copy.
No. It is a server-side Express property. Browsers only send HTTP requests to your app.