diff options
Diffstat (limited to 'doc/api/http.md')
-rw-r--r-- | doc/api/http.md | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/api/http.md b/doc/api/http.md index 9493c6a269..b6fa32a3c0 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -2144,9 +2144,10 @@ it will switch to implicit header mode and flush the implicit headers. This sends a chunk of the response body. This method may be called multiple times to provide successive parts of the body. -In the `node:http` module, the response body is omitted when the -request is a HEAD request. Similarly, the `204` and `304` responses -_must not_ include a message body. +Writing to the body is not allowed when the request method or response status +do not support content. If an attempt is made to write to the body for a +HEAD request or as part of a `204` or `304`response, a synchronous `Error` +with the code `ERR_HTTP_BODY_NOT_ALLOWED` is thrown. `chunk` can be a string or a buffer. If `chunk` is a string, the second parameter specifies how to encode it into a byte stream. |