From f3874db3495ca1a4e1b9e88f5333c4f1ceedaf88 Mon Sep 17 00:00:00 2001 From: Mao Wtm Date: Sat, 22 Jun 2019 11:12:48 +0800 Subject: [PATCH] doc: clearify that http does chunked encoding itself Co-authored-by: Antoine du Hamel --- doc/api/http.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/api/http.md b/doc/api/http.md index 809b2b0c44d095..7ca9525e9a55b0 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1003,11 +1003,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'`.