我response.send()
在docs中找不到,但是我假设.send()
将填写并发送响应,因此只能调用一次,而.write()
只会编写响应,但是您必须使用发送response.end()
这意味着您可以使用来编辑标题,.write()
因为尚未发送响应。
:
response.send()
是Restify Response API包装器的一部分
Node js中response.send和response.write之间的区别
我response.send()
在docs中找不到,但是我假设.send()
将填写并发送响应,因此只能调用一次,而.write()
只会编写响应,但是您必须使用发送response.end()
这意味着您可以使用来编辑标题,.write()
因为尚未发送响应。
:
response.send()
是Restify Response API包装器的一部分