简体   繁体   中英

What events do http.IncomingMessage implement nodejs

I have been looking into nodejs and was wondering how to get POST requests. I had a look online and found that if I used the 'data' event on the request I could get the post requests. I don't know whether the documentation has changed but on the events section of the api it only has the 'close' event.

Does the 'data' event still work and if so why isn't in the documentation?

Thanks for any answers!

Does the 'data' event still work and if so why isn't in the documentation?

Yeah, it'll work. And, it is documented, but it's inherited behavior.

It implements the Readable Stream interface, as well as the following additional events, methods, and properties.

Events are documented with the class which implements them, so 'close' is documented with http.IncomingMessage while 'data' , 'end' , etc. are documented under stream.Readable .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM