From 56ae77a25d079bcc76b425434d7578981b6e83f7 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sun, 26 May 2019 20:08:10 +0200 Subject: [PATCH] http: document edge case in http request --- doc/api/http.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/api/http.md b/doc/api/http.md index aaeb9403ff499b..fb7b5f993c8005 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -2061,8 +2061,13 @@ order: (`'data'` will not be emitted at all if the response body is empty, for instance, in most redirects) * `'end'` on the `res` object +* `'error'` if the server response is received while still writing to request. * `'close'` +Note that `response` can be emitted even before the client request has +been ended (`end()`). If the client is still writing after `response` an +`ECONNRESET` error might also be emitted. + In the case of a connection error, the following events will be emitted: * `'socket'`