Node.js · Module
node:http
node:http provides low-level HTTP client and server APIs. It uses streams, so requests and responses do not need to be buffered in full.
Last updated
- Since
- v0.1.0
Syntax
import http from 'node:http';
const server = http.createServer((request, response) => {});
const request = http.request(options[, callback]);
const request = http.get(options[, callback]);In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
http.Agenthttp.createServer()http.get()http.request()http.IncomingMessagehttp.ServerResponserequest.destroy()request.setTimeout()