res.append() adds a value to an HTTP response header. If the header is not set yet, Express creates it. If it already has values, the new value is added — nothing already set is removed.
Use it for multi-value headers such as Link, Set-Cookie, or Warning. To replace a header completely, use res.set() instead. Call it before you send the body with res.send() or similar.
Syntax
Call res.append in your Express.js app. Start with this line.
GET /order
→ Warning: 299 - "new value"
(the 199 append was cleared by res.set)
Safe pattern: set first (if needed), then only append:
res.set('Warning', '199 - "base"');
res.append('Warning', '299 - "extra"');
How It Works
Append stores the first warning. Header becomes 199 - "old value".
Set replaces the whole field. Official docs: calling res.set() after res.append() resets the previously set value.
Only the set value remains. Clients never see the appended 199 line.
Safe order: set once if you need a base value, then append extras — never set again for that field.
Compatibility
Runtime Support
res.append() is an Express.js response method. It runs on a Node.js server (Express 5 needs Node.js 18+). Browsers do not call it — they only receive the headers your server sends.
✓ Server · Express 4.11+ & 5
res.append()
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 · Express 4.11+ for append
Supported
BunExpress-compatible server apps
Supported
DenoVia npm compatibility / adapters
Supported
res.append()Express 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 appends one or more values to an HTTP response header. If the header is missing, Express creates it. Existing values stay; new ones are added.
res.set() replaces the header value. res.append() keeps what is already there and adds another value. Prefer append for multi-value headers such as Set-Cookie or Link.
Yes. Pass a string or an array of strings. Express appends each array item for that header field.
res.set() resets that header and drops the values you appended earlier. Append after set, or avoid set for the same field once you have started appending.
It was added in Express 4.11.0 and is available in Express 4 and Express 5. It is not deprecated.