Skip to content

Commit

Permalink
doc: document the 'close' and 'finish' events
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
lpinca authored and juanarbol committed May 31, 2022
1 parent 8ae240e commit 02d8c3b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,15 @@ deprecated: v16.12.0
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
Expand Down Expand Up @@ -519,6 +528,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
Expand Down

0 comments on commit 02d8c3b

Please sign in to comment.