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 <jonathan.persson@creuna.se>
    committer: James M Snell <jasnell@gmail.com>
    summary: doc: add links and backticks around names

PR-URL: #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>
  • Loading branch information
galeo authored and MylesBorins committed Sep 5, 2017
1 parent c307f03 commit 8dbf827
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 @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8dbf827

Please sign in to comment.