Skip to content

Commit f3874db

Browse files
micromaomaoaduh95
andcommitted
doc: clearify that http does chunked encoding itself
Co-authored-by: Antoine du Hamel <[email protected]>
1 parent 7809c4f commit f3874db

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
@@ -1003,11 +1003,11 @@ added: v0.1.29
10031003
*`callback`{Function}
10041004
* Returns:{boolean}
10051005

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

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

0 commit comments

Comments
(0)