doc: clearify that http does chunked encoding itself

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/28379
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Mao Wtm 2019-06-22 11:12:48 +08:00 committed by Daniele Belardi
parent 4e17ffc793
commit 67d4a3f9bd
No known key found for this signature in database
GPG Key ID: 91C67200C945858D

View File

@ -1031,11 +1031,11 @@ added: v0.1.29
* `callback` {Function}
* Returns: {boolean}
Sends a chunk of the body. By calling this method
many times, a request body can be sent to a
server. In that case, it is suggested to use the
`['Transfer-Encoding', 'chunked']` header line when
creating the request.
Sends a chunk of the body. This method can be called multiple times. If no
`Content-Length` is set, data will automatically be encoded in HTTP Chunked
transfer encoding, so that server knows when the data ends. The
`Transfer-Encoding: chunked` header is added. Calling [`request.end()`][]
is necessary to finish sending the request.
The `encoding` argument is optional and only applies when `chunk` is a string.
Defaults to `'utf8'`.