The http.IncomingMessage Object

Either the HTTP server or the HTTP client creates the IncomingMessage object. On the server side the client request is represented by an IncomingMessage object, and on the client side the server response is represented by an IncomingMessage object. The reason that the IncomingMessage object can be used for both is that the functionality is basically the same.

The IncomingMessage object implements a Readable stream, allowing you to read the client request or server response as a streaming source. This means that the readable and data events can be listened on and used to read data from the stream.

In addition to the functionality provided by the Readable class, IncomingMessage objects also provide the properties, events, and methods listed in Table 7.7. These allow you to access information from the client request or server response.

Image

Table 7.7 Events, properties, and methods available on IncomingMessage objects

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.98.186