Skip to content

Commit 8dbf827

Browse files
galeoMylesBorins
authored andcommitted
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 14b3aab: date: 28 November 2015 at 7:30:32 AM GMT+8 author: jpersson <[email protected]> committer: James M Snell <[email protected]> summary: doc: add links and backticks around names PR-URL: #14126 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: David Cai <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]>
1 parent c307f03 commit 8dbf827

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

doc/api/http.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ unsent, it will flush them to the stream. If the request is
474474
chunked, this will send the terminating `'0\r\n\r\n'`.
475475

476476
If `data` is specified, it is equivalent to calling
477-
[`response.write(data, encoding)`][] followed by `request.end(callback)`.
477+
[`request.write(data, encoding)`][] followed by `request.end(callback)`.
478478

479479
If `callback` is specified, it will be called when the request stream
480480
is finished.
@@ -1670,6 +1670,7 @@ There are a few special headers that should be noted.
16701670
[`net.Server.listen(port)`]: net.html#net_server_listen_port_hostname_backlog_callback
16711671
[`net.Socket`]: net.html#net_class_net_socket
16721672
[`request.socket.getPeerCertificate()`]: tls.html#tls_tlssocket_getpeercertificate_detailed
1673+
[`request.write(data, encoding)`]: #http_request_write_chunk_encoding_callback
16731674
[`response.end()`]: #http_response_end_data_encoding_callback
16741675
[`response.setHeader()`]: #http_response_setheader_name_value
16751676
[`response.write()`]: #http_response_write_chunk_encoding_callback

0 commit comments

Comments
 (0)