node.js - nodejs 的 http 模块不是可以一次接收/发送整个请求/响应吗?

标签 node.js http nodejs-stream

我正在学习 nodejshttp 模块。我在 documentation 中找到了一个部分上面写着:

The interface is careful to never buffer entire requests or responses

这是否意味着该模块不能一次接收/发送整个请求/响应,而是分块接收/发送?

最佳答案

Does it means that this module is not capable of receiving / sending the whole request / response at once and it receives / sends in chunks instead?

没错:http 是基于流的,就像底层的 net 模块一样。

有很多模块可用于为您抽象这些流,并提供接收完整的响应(在内存中,所以要小心大响应)。例如,requesthttp.min .

关于node.js - nodejs 的 http 模块不是可以一次接收/发送整个请求/响应吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53710463/

相关文章:

node.js - node.js 中函数调用后 API 的响应范围

javascript - NodeJS 中的一个 Heroku dyno 上的多个作业

node.js - Docker 容器 'Connect ECONNREFUSED localhost'

python - 使用 google ip 而不是域名时的 TooManyRedirects

node.js - 如何在nodejs中使用pdfkit将png格式保存为pdf格式[包含代码]

javascript - Writable Stream清空文件但不写入nodeJS中预期的内容

javascript - codeSandBox (React/Node) 的 Http 请求错误

node.js - 无法找到安全性较低的应用程序设置

node.js - Vue.js : Extract actual code from production version minimized files

PHP header() 调用 "crashing"脚本出现 HTTP 500 错误