In Express.js, req.get(field) returns the value of a named HTTP request header. The name match is case-insensitive, so Content-Type and content-type both work. Missing headers return undefined.
Special case from the official docs: Referrer and Referer are interchangeable. The method is also aliased as req.header(field). It runs on the server via the request object.
Syntax
Call req.get in your Express.js app. Start with this line.
Express
req.get(field)
req.header(field) // alias
Call
What it does
req.get(field)
Primary signature.
req.header(field) // alias
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.
HTTP uses Referer. The historic misspelling is the real header name on the wire.
Express accepts both.req.get('Referrer') and req.get('Referer') read the same field.
Values match. When the header is present, both calls return the same string.
Still optional. Many clients omit it for privacy — always allow undefined.
Compatibility
Runtime Support
req.get() is an Express.js request method. It runs on a Node.js server (Express 5 needs Node.js 18+). Browsers only send headers; they do not call req.get().
✓ Server · Express 4 & 5
req.get()
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.get()Express on Node.js
Bottom line: Study and run these examples with Node.js and the express package. Use req.get(name) whenever you need one request header.
Frequently Asked Questions
It returns the value of a named HTTP request header. Matching is case-insensitive. Missing headers return undefined.
No. req.header(field) is an alias of req.get(field). Prefer one style and stick to it.
Yes for req.get(). Express treats Referrer and Referer as interchangeable spellings of the same header.
req.get returns the raw header string. req.is() checks whether that Content-Type matches a type you care about (json, html, and so on).
No. Clients control most request headers. Validate Authorization and custom headers before using them for security decisions.