Skip to content

Commit 56ae77a

Browse files
committed
http: document edge case in http request
1 parent f8f9601 commit 56ae77a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc/api/http.md

+5
Original file line numberDiff line numberDiff line change
@@ -2061,8 +2061,13 @@ order:
20612061
(`'data'` will not be emitted at all if the response body is empty, for
20622062
instance, in most redirects)
20632063
* `'end'` on the `res` object
2064+
* `'error'` if the server response is received while still writing to request.
20642065
* `'close'`
20652066

2067+
Note that `response` can be emitted even before the client request has
2068+
been ended (`end()`). If the client is still writing after `response` an
2069+
`ECONNRESET` error might also be emitted.
2070+
20662071
In the case of a connection error, the following events will be emitted:
20672072

20682073
* `'socket'`

0 commit comments

Comments
 (0)