From 57aa9fc74c282598cb84867747bf152055f9156a Mon Sep 17 00:00:00 2001 From: Moogen Tian Date: Sat, 8 Jul 2017 00:05:08 +0800 Subject: [PATCH 1/2] doc: fix mistake in http.md 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 --- doc/api/http.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/http.md b/doc/api/http.md index a9e9cd3876f380..78b47c11cc9cc9 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. From 889becc3b3d9a2ac19d7c6811e31a266240ffc89 Mon Sep 17 00:00:00 2001 From: Moogen Tian Date: Sat, 8 Jul 2017 01:47:41 +0800 Subject: [PATCH 2/2] doc: add reference for request.write in http.md This should finish up the previous commit. Refs: https://github.com/nodejs/node/pull/14126 --- doc/api/http.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/api/http.md b/doc/api/http.md index 78b47c11cc9cc9..40715d5f33ec1a 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -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