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 MylesBorins committed Aug 16, 2017
1 parent f868b75 commit 7a1ff59
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 7a1ff59

Please sign in to comment.