IncomingMessage
The Node.js object for an HTTP request a server has received, or a response a client has received, which is a Readable stream of the body.
In more detail
It carries the method, url and headers, and you read the body with for await or by piping it. Consuming it as a stream keeps memory low for large uploads.
Related terms
- node:http — The built-in Node.js module for writing HTTP/1.1 servers and clients, which web frameworks such as Express and Fastify build on.
- Readable stream — A Node.js stream you read data from, such as a file being read, an incoming HTTP request or a socket.
- ServerResponse — The Node.js object a server uses to answer one HTTP request: a Writable stream with methods for setting the status and headers.
Taught in
- Native HTTP Server: Request & Response Lifecycles — Node.js Internals & Backend Services