Skip to content

Commit 02d8c3b

Browse files
lpincajuanarbol
authored andcommitted
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: #42704 Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Akhil Marsonya <[email protected]> Reviewed-By: Mestery <[email protected]>
1 parent 8ae240e commit 02d8c3b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/api/http.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,15 @@ deprecated: v16.12.0
434434
Emitted when the request has been aborted by the client. This event is only
435435
emitted on the first call to `abort()`.
436436

437+
### Event: `'close'`
438+
439+
<!-- YAML
440+
added: v0.5.4
441+
-->
442+
443+
Indicates that the request is completed, or its underlying connection was
444+
terminated prematurely (before the response completion).
445+
437446
### Event: `'connect'`
438447

439448
<!-- YAML
@@ -519,6 +528,17 @@ Emitted when the server sends a '100 Continue' HTTP response, usually because
519528
the request contained 'Expect: 100-continue'. This is an instruction that
520529
the client should send the request body.
521530

531+
### Event: `'finish'`
532+
533+
<!-- YAML
534+
added: v0.3.6
535+
-->
536+
537+
Emitted when the request has been sent. More specifically, this event is emitted
538+
when the last segment of the response headers and body have been handed off to
539+
the operating system for transmission over the network. It does not imply that
540+
the server has received anything yet.
541+
522542
### Event: `'information'`
523543

524544
<!-- YAML

0 commit comments

Comments
 (0)