response.end([data[, encoding]][, callback])


此方法向服务器表示所有响应头和响应体都已发送;服务器应视此消息为已完成。每个响应都必须调用 response.end() 方法。

【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.】

如果指定了 data,其效果类似于先调用 response.write(data, encoding),然后再调用 response.end(callback)

【If data is specified, it is similar in effect to calling response.write(data, encoding) followed by response.end(callback).】

如果指定了 callback,当响应流完成时,它将被调用。

【If callback is specified, it will be called when the response stream is finished.】