request.destroy([error])


  • error <Error> 可选,通过 'error' 事件发出的错误。
  • 返回:<this>

销毁请求。可以选择发送一个 'error' 事件,并发送一个 'close' 事件。调用此方法会导致响应中剩余的数据被丢弃,并销毁套接字。

【Destroy the request. Optionally emit an 'error' event, and emit a 'close' event. Calling this will cause remaining data in the response to be dropped and the socket to be destroyed.】

有关详细信息,请参见writable.destroy()

【See writable.destroy() for further details.】