Skip to content

Commit 0c2b5a0

Browse files
micromaomaotargos
authored andcommitted
doc: clearify that http does chunked encoding itself
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #28379 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent f13a302 commit 0c2b5a0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/api/http.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,11 +1002,11 @@ added: v0.1.29
10021002
* `callback` {Function}
10031003
* Returns: {boolean}
10041004

1005-
Sends a chunk of the body. By calling this method
1006-
many times, a request body can be sent to a
1007-
server. In that case, it is suggested to use the
1008-
`['Transfer-Encoding', 'chunked']` header line when
1009-
creating the request.
1005+
Sends a chunk of the body. This method can be called multiple times. If no
1006+
`Content-Length` is set, data will automatically be encoded in HTTP Chunked
1007+
transfer encoding, so that server knows when the data ends. The
1008+
`Transfer-Encoding: chunked` header is added. Calling [`request.end()`][]
1009+
is necessary to finish sending the request.
10101010

10111011
The `encoding` argument is optional and only applies when `chunk` is a string.
10121012
Defaults to `'utf8'`.

0 commit comments

Comments
 (0)