From 217e1dc7b1ddd190a492cb9f2248b3a6ee86af83 Mon Sep 17 00:00:00 2001 From: Moogen Tian Date: Sat, 8 Jul 2017 00:05:08 +0800 Subject: [PATCH] doc: fix mistake in http.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the first parameter of `request.end` `data` is specified, it should be equivalent to calling `request.write(data, encoding)` (not `response.write(data, encoding)`) followed by `request.end(callback)`. This mistake was introduced in commit 14b3aab7d289a568e4a9efa6cd07a6ced370e318: date: 28 November 2015 at 7:30:32 AM GMT+8 author: jpersson committer: James M Snell summary: doc: add links and backticks around names PR-URL: https://github.com/nodejs/node/pull/14126 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: David Cai Reviewed-By: Michael Dawson Reviewed-By: Vse Mozhet Byt --- doc/api/http.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/http.md b/doc/api/http.md index e71b22649ea59c..f7843fe2be180f 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -519,7 +519,7 @@ unsent, it will flush them to the stream. If the request is chunked, this will send the terminating `'0\r\n\r\n'`. If `data` is specified, it is equivalent to calling -[`response.write(data, encoding)`][] followed by `request.end(callback)`. +[`request.write(data, encoding)`][] followed by `request.end(callback)`. If `callback` is specified, it will be called when the request stream is finished. @@ -1900,6 +1900,7 @@ const req = http.request(options, (res) => { [`net.createConnection()`]: net.html#net_net_createconnection_options_connectlistener [`request.socket`]: #http_request_socket [`request.socket.getPeerCertificate()`]: tls.html#tls_tlssocket_getpeercertificate_detailed +[`request.write(data, encoding)`]: #http_request_write_chunk_encoding_callback [`response.end()`]: #http_response_end_data_encoding_callback [`response.setHeader()`]: #http_response_setheader_name_value [`response.socket`]: #http_response_socket