0
Everybody knows how to use the request
and response
properly as callback parameters of the http.createServer
, and that we use these two parameters as objects inside the callback.
I searched the DOC’s API and there it says that both are object instances http.IncomingMensage
and which, in turn, is created by http.Server
(request) and http.ClientRequest
(sponse)...
I was confused because in the DOC they refer to http.Server
as an event broadcaster and the http.ClientRequest
as an object builder. I tried to understand native code in Node’s lib and there I found them all in their places but still didn’t understand.
The question is: what happens behind a standard server build using the request
and response
? What exactly are?
Obs, I know how to build eventListeners and Emitters using the http.events
simply.
Source code: http.Clientrequest, http. Server, http.Incomingmensage, http.createServer
As far as I know they are simple objects that you use to manipulate the request and the answer. They are not events. I don’t think I understand your question...
– bfavaretto
http://nodejs.org/api/http.html#http_class_http_server, here for example refers to
request
as an event that is instance of Incomingmensage @bfavaretto– ropbla9
I think I understand your confusion, I’ll answer.
– bfavaretto
Managed to Resolve That Question?
– durtto