From 76e7170a40caf90b49827d156f37e0f3fe56fb2e Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Fri, 15 Apr 2022 00:09:19 +0200 Subject: [PATCH] doc: document the 'close' and 'finish' events These events are already documented as events of the `http.ServerResponse` class. Document that they can also be emitted on instances of the `http.ClientRequest` class. PR-URL: https://github.com/nodejs/node/pull/42704 Reviewed-By: Paolo Insogna Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Akhil Marsonya Reviewed-By: Mestery --- doc/api/http.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc/api/http.md b/doc/api/http.md index 8ad131af886c8a..b6df4a2409362b 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -438,6 +438,15 @@ deprecated: Emitted when the request has been aborted by the client. This event is only emitted on the first call to `abort()`. +### Event: `'close'` + + + +Indicates that the request is completed, or its underlying connection was +terminated prematurely (before the response completion). + ### Event: `'connect'` + +Emitted when the request has been sent. More specifically, this event is emitted +when the last segment of the response headers and body have been handed off to +the operating system for transmission over the network. It does not imply that +the server has received anything yet. + ### Event: `'information'`