response.end([data[, encoding]][, callback])
data
<string> | <Buffer> | <Uint8Array>encoding
<string>callback
<Function>- 返回: <this>
此方法向服务器发出信号,表明所有响应头和正文都已发送;该服务器应认为此消息已完成。
response.end()
方法必须在每个响应上调用。
如果指定了 data
,则其效果类似于调用 response.write(data, encoding)
后跟 response.end(callback)
。
如果指定了 callback
,则将在响应流完成时调用。
data
<string> | <Buffer> | <Uint8Array>encoding
<string>callback
<Function>- Returns: <this>
This method signals to the server that all of the response headers and body
have been sent; that server should consider this message complete.
The method, response.end()
, MUST be called on each response.
If data
is specified, it is similar in effect to calling
response.write(data, encoding)
followed by response.end(callback)
.
If callback
is specified, it will be called when the response stream
is finished.