Skip to content

Commit 3c1bd05

Browse files
krydosMylesBorins
authored andcommitted
doc: response.write ignores body in some cases
PR-URL: #12314 Fixes: #8057 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent d2afd7c commit 3c1bd05

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/api/http.md

+4
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,10 @@ it will switch to implicit header mode and flush the implicit headers.
10911091
This sends a chunk of the response body. This method may
10921092
be called multiple times to provide successive parts of the body.
10931093

1094+
Note that in the `http` module, the response body is omitted when the
1095+
request is a HEAD request. Similarly, the `204` and `304` responses
1096+
_must not_ include a message body.
1097+
10941098
`chunk` can be a string or a buffer. If `chunk` is a string,
10951099
the second parameter specifies how to encode it into a byte stream.
10961100
By default the `encoding` is `'utf8'`. `callback` will be called when this chunk

0 commit comments

Comments
 (0)