Everyone knows how to use request
and response
properly as http.createServer
callback parameters, and that we use these two parameters as objects within the callback.
I searched the DOC's API and there it says that both are instances of the object http.IncomingMensage
and that, in turn, is created by http.Server
(request) and http.ClientRequest
(response) ...
I was confused because in DOC they refer to http.Server
as an event sender and http.ClientRequest
as an object constructor. I tried to understand the native code in the node's lib and there I found all of them in their places but I still did not understand.
Doubt is: What happens behind a standard server build using request
and response
? What exactly are they?