HTTP
Target host name. @compat elide Full
Module:node:http
Support: Experimental
7 members: 2 supported, 5 undocumented
Static Methods
Properties
All supported HTTP methods as an array of strings. @compat elide Full
Map of HTTP status codes to their standard reason phrases. @compat elide Full
The global HTTP agent used for connection pooling. @compat elide Full
Maximum allowed HTTP header size in bytes.
Dictionary ServerOptions
Options for creating an HTTP server.
Since: 1.1.0 Docs: Node.js Docs3 members: 3 undocumented
Properties
Allow non-standard HTTP parsing (relaxed header validation).
Maximum allowed HTTP header size in bytes.
If true, duplicate header fields are joined with a comma.
---
Interface Server
An HTTP server that listens for incoming connections. Created via http.createServer(); extends EventEmitter for connection/request events.
Extends: NetServer Implements: EventEmitter Since: 1.1.0 Docs: Node.js Docs15 members: 7 supported, 8 undocumented
Methods
Properties
Begins accepting connections on the specified port and host.
Maximum number of simultaneous connections allowed. @compat elide Full
Maximum requests per socket before the socket is closed. @compat elide Full
Timeout in milliseconds before response headers must be sent. @compat elide Full
Timeout in milliseconds for each incoming request. @compat elide Full
Timeout in milliseconds for each incoming request. @compat elide Full
Keep-alive socket timeout in milliseconds. @compat elide Full
---
Interface IncomingMessage
Represents an incoming HTTP message (request on a server, or response on a client).
Extends: Readable Implements: EventEmitter Since: 1.1.0 Docs: Node.js Docs18 members: 2 supported, 16 undocumented
Methods
Properties
True if the message has been fully received. @compat elide Full
True if the message has been fully received. @compat elide Full
Maximum requests per socket before the socket is closed. @compat elide Full
Header fields grouped into arrays by name. @compat elide Full
Raw header names and values as alternating strings in the original order. @compat elide Full
Parsed trailer fields (populated after the message body). @compat elide Full
Trailer fields grouped into arrays by name. @compat elide Full
Raw trailer names and values. @compat elide Full
Full HTTP version string (e.g. "1.1"). @compat elide Full
Major HTTP version number. @compat elide Full
Minor HTTP version number. @compat elide Full
Minor HTTP version number. @compat elide Full
Request URL string (only set on server-side requests). @compat elide Full
Response status code (only set on client-side responses). @compat elide Full
Response status message (only set on client-side responses). @compat elide Full
Maximum number of simultaneous connections allowed. @compat elide Full
---
Interface ServerResponse
Writable HTTP server response sent back to the client.
Extends: Writable Implements: EventEmitter Since: 1.1.0 Docs: Node.js Docs21 members: 13 supported, 8 undocumented
Methods
Properties
Response status code (only set on client-side responses). @compat elide Full
Response status message (only set on client-side responses). @compat elide Full
True if response headers have already been flushed to the client. @compat elide Full
Maximum number of simultaneous connections allowed. @compat elide Full
True if end() has been called. @compat elide Full
True if the response has been fully flushed to the kernel. @compat elide Full
---
Interface ClientRequest
An outgoing HTTP request made by the client.
Extends: Writable Implements: EventEmitter Since: 1.1.0 Docs: Node.js Docs15 members: 10 supported, 5 undocumented
Methods
Properties
Minor HTTP version number. @compat elide Full
HTTP method for this request. @compat elide Full
Request path including query string. @compat elide Full
Protocol (e.g. "http:"). @compat elide Full
True if the request reused a keep-alive socket. @compat elide Full
---
Details
abort()
abort()
abort()
Aborts the request.
> Known issue: Deprecated since Node.js v14.1.0; use destroy() instead
---