Skip to content

Commit 217e1dc

Browse files
galeoaddaleax
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 4f0eb6f commit 217e1dc

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
@@ -519,7 +519,7 @@ unsent, it will flush them to the stream. If the request is
519519
chunked, this will send the terminating `'0\r\n\r\n'`.
520520

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

524524
If `callback` is specified, it will be called when the request stream
525525
is finished.
@@ -1900,6 +1900,7 @@ const req = http.request(options, (res) => {
19001900
[`net.createConnection()`]: net.html#net_net_createconnection_options_connectlistener
19011901
[`request.socket`]: #http_request_socket
19021902
[`request.socket.getPeerCertificate()`]: tls.html#tls_tlssocket_getpeercertificate_detailed
1903+
[`request.write(data, encoding)`]: #http_request_write_chunk_encoding_callback
19031904
[`response.end()`]: #http_response_end_data_encoding_callback
19041905
[`response.setHeader()`]: #http_response_setheader_name_value
19051906
[`response.socket`]: #http_response_socket

0 commit comments

Comments
 (0)