package http
- Alphabetic
- Public
- All
Type Members
-
class
ClientRequest
extends Object with Readable
http.ClientRequest - This object is created internally and returned from http.request().
http.ClientRequest - This object is created internally and returned from http.request(). It represents an in-progress request whose header has already been queued. The header is still mutable using the setHeader(name, value), getHeader(name), removeHeader(name) API. The actual header will be sent along with the first data chunk or when closing the connection.
To get the response, add a listener for 'response' to the request object. 'response' will be emitted from the request object when the response headers have been received. The 'response' event is executed with one argument which is an instance of http.IncomingMessage.
During the 'response' event, one can add listeners to the response object; particularly to listen for the 'data' event. If no 'response' handler is added, then the response will be entirely discarded. However, if you add a 'response' event handler, then you must consume the data from the response object, either by calling response.read() whenever there is a 'readable' event, or by adding a 'data' handler, or by calling the .resume() method. Until the data is consumed, the 'end' event will not fire. Also, until the data is read it will consume memory that can eventually lead to a 'process out of memory' error.
Note: Node.js does not check whether Content-Length and the length of the body which has been transmitted are equal or not.
- Annotations
- @RawJSType() @native() @JSImport( "http" , "ClientRequest" )
-
trait
IncomingMessage
extends Object with Readable
An IncomingMessage object is created by http.Server or http.ClientRequest and passed as the first argument to the 'request' and 'response' event respectively.
An IncomingMessage object is created by http.Server or http.ClientRequest and passed as the first argument to the 'request' and 'response' event respectively. It may be used to access response status, headers and data. It implements the Readable Stream interface, as well as the following additional events, methods, and properties.
- Annotations
- @RawJSType() @native()
- See also
https://nodejs.org/api/http.html#http_class_http_incomingmessage
-
trait
OutgoingMessage
extends Object with Writable
Outgoing Message
Outgoing Message
- Annotations
- @RawJSType() @native()
-
class
Server
extends net.Server
http.Server - This class inherits from net.Server and has the following additional events
http.Server - This class inherits from net.Server and has the following additional events
- Annotations
- @RawJSType() @native() @JSImport( "http" , "Server" )
-
trait
ServerResponse
extends Object with IEventEmitter with IDuplex
Node.js http.ServerResponse
Node.js http.ServerResponse
- Annotations
- @RawJSType() @native()
- See also
https://nodejs.org/api/http.html#http_class_http_serverresponse
Value Members
-
object
ClientRequest
Client Request Companion
-
object
IncomingMessage
Incoming Message Companion
-
object
Server
Server Companion
-
object
ServerResponse
Server Response