我一直在研究nodejs,想知道如何获取POST 请求。我在网上查看了一下,发现如果我在请求上使用“数据”事件,我可以获得发布请求。我不知道文档是否已更改,但在 api 的事件部分,它只有“关闭”事件。
“数据”事件仍然有效吗?如果有效,为什么文档中没有?
感谢您的回答!
最佳答案
Does the 'data' event still work and if so why isn't in the documentation?
是的,它会起作用。而且,它是有记录的,但它是继承的行为。
It implements the Readable Stream interface, as well as the following additional events, methods, and properties.
事件由实现它们的类记录,因此 'close'
由 http.IncomingMessage
记录,而 'data'
, 'end'
等记录在 stream.Readable
下。
关于javascript - http.IncomingMessage实现nodejs有哪些事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18609979/