Skip to content

Commit

Permalink
doc: fix mistake in http.md
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
galeo authored and addaleax committed Jul 18, 2017
1 parent 4f0eb6f commit 217e1dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 217e1dc

Please sign in to comment.