request.destroy([error])


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

销毁请求。可以选择触发一个 'error' 事件,并触发一个 'close' 事件。调用此操作会导致响应中剩余的数据被丢弃,并且如果正在使用则销毁套接字,否则如果可能则返回到相应的 Agent 池中。

🌐 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 if used, or returned to the corresponding Agent pool otherwise if possible.

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

🌐 See writable.destroy() for further details.