Skip to content

Commit e2d66ab

Browse files
krydosevanlucas
authored andcommitted
doc: response.write ignores body in some cases
PR-URL: #12314 Fixes: #8057 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent d1e1832 commit e2d66ab

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
@@ -1161,6 +1161,10 @@ it will switch to implicit header mode and flush the implicit headers.
11611161
This sends a chunk of the response body. This method may
11621162
be called multiple times to provide successive parts of the body.
11631163

1164+
Note that in the `http` module, the response body is omitted when the
1165+
request is a HEAD request. Similarly, the `204` and `304` responses
1166+
_must not_ include a message body.
1167+
11641168
`chunk` can be a string or a buffer. If `chunk` is a string,
11651169
the second parameter specifies how to encode it into a byte stream.
11661170
By default the `encoding` is `'utf8'`. `callback` will be called when this chunk

0 commit comments

Comments
 (0)