Skip to content

Commit 2bf33c0

Browse files
committed
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.
1 parent 08773e3 commit 2bf33c0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/api/http.md

+20
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,15 @@ deprecated:
438438
Emitted when the request has been aborted by the client. This event is only
439439
emitted on the first call to `abort()`.
440440

441+
### Event: `'close'`
442+
443+
<!-- YAML
444+
added: v0.5.9
445+
-->
446+
447+
Indicates that the request is completed, or its underlying connection was
448+
terminated prematurely (before the response completion).
449+
441450
### Event: `'connect'`
442451

443452
<!-- YAML
@@ -523,6 +532,17 @@ Emitted when the server sends a '100 Continue' HTTP response, usually because
523532
the request contained 'Expect: 100-continue'. This is an instruction that
524533
the client should send the request body.
525534

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

528548
<!-- YAML

0 commit comments

Comments
 (0)