Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2022-04-15 01:09:19 +0300
committerMichaƫl Zasso <targos@protonmail.com>2022-04-28 07:56:09 +0300
commit2a07a9fc3a05e08b8d0ad2b9a590ed73eeda2943 (patch)
tree6b04147351f4236057fa1ecbd3dbd3766104cd69 /doc/api/http.md
parentef5ab8179b8488fa8115fa401553d22c6e51bcf7 (diff)
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 <paolo@cowtech.it> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com>
Diffstat (limited to 'doc/api/http.md')
-rw-r--r--doc/api/http.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/api/http.md b/doc/api/http.md
index 7307bee93ad..44af77c3102 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'`
+
+<!-- YAML
+added: v0.5.4
+-->
+
+Indicates that the request is completed, or its underlying connection was
+terminated prematurely (before the response completion).
+
### Event: `'connect'`
<!-- YAML
@@ -523,6 +532,17 @@ Emitted when the server sends a '100 Continue' HTTP response, usually because
the request contained 'Expect: 100-continue'. This is an instruction that
the client should send the request body.
+### Event: `'finish'`
+
+<!-- YAML
+added: v0.3.6
+-->
+
+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'`
<!-- YAML