request.destroy([error])


  • error <Error> 可选,与 'error' 事件一起触发的错误。
  • 返回: <this>

销毁请求。 可选地触发 'error' 事件,并发出 'close' 事件。 调用它会导致响应中的剩余数据被丢弃并销毁套接字。

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

  • error <Error> Optional, an error to emit with 'error' event.
  • Returns: <this>

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.

See writable.destroy() for further details.