summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoogen Tian <moogentian@outlook.com>2017-07-08 00:05:08 +0800
committerMyles Borins <mylesborins@google.com>2017-09-05 12:49:52 -0400
commit8dbf827de36b565231583d3725178bf00e355baf (patch)
tree061c6b09a82375bacdd90a6450dbc1b1cce53e71
parentc307f03b2b30701230c354e098b31d87ed1baea4 (diff)
downloadnode-new-8dbf827de36b565231583d3725178bf00e355baf.tar.gz
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 <jonathan.persson@creuna.se> committer: James M Snell <jasnell@gmail.com> summary: doc: add links and backticks around names PR-URL: https://github.com/nodejs/node/pull/14126 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: David Cai <davidcai1993@yahoo.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
-rw-r--r--doc/api/http.md3
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/api/http.md b/doc/api/http.md
index faefc803f7..94f2ec7552 100644
--- a/doc/api/http.md
+++ b/doc/api/http.md
@@ -474,7 +474,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.
@@ -1670,6 +1670,7 @@ There are a few special headers that should be noted.
[`net.Server.listen(port)`]: net.html#net_server_listen_port_hostname_backlog_callback
[`net.Socket`]: net.html#net_class_net_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.write()`]: #http_response_write_chunk_encoding_callback