summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMark S. Everitt <mark.s.everitt@gmail.com>2019-02-06 22:24:50 +0000
committerAnna Henningsen <anna@addaleax.net>2019-02-09 16:34:25 +0100
commit1aa11e14440dc531a7208128b6416814f7b0964b (patch)
tree06ac2f7f58ee3996762bf8f4aca77343e2ecd43a /doc
parentf93df511558609fad38fe0ae34635c7c914ad2f8 (diff)
downloadandroid-node-v8-1aa11e14440dc531a7208128b6416814f7b0964b.tar.gz
android-node-v8-1aa11e14440dc531a7208128b6416814f7b0964b.tar.bz2
android-node-v8-1aa11e14440dc531a7208128b6416814f7b0964b.zip
http2: makes response.writeHead return the response
Fixes: https://github.com/nodejs/node/issues/25935 PR-URL: https://github.com/nodejs/node/pull/25974 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/http2.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/api/http2.md b/doc/api/http2.md
index 4c241268b0..f8eb4ab1a3 100644
--- a/doc/api/http2.md
+++ b/doc/api/http2.md
@@ -3283,15 +3283,23 @@ should be sent. See the [`'checkContinue'`][] event on `Http2Server` and
#### response.writeHead(statusCode[, statusMessage][, headers])
<!-- YAML
added: v8.4.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/25974
+ description: Return `this` from `writeHead()` to allow chaining with
+ `end()`.
-->
* `statusCode` {number}
* `statusMessage` {string}
* `headers` {Object}
+* Returns: {http2.Http2ServerResponse}
Sends a response header to the request. The status code is a 3-digit HTTP
status code, like `404`. The last argument, `headers`, are the response headers.
+Returns a reference to the `Http2ServerResponse`, so that calls can be chained.
+
For compatibility with [HTTP/1][], a human-readable `statusMessage` may be
passed as the second argument. However, because the `statusMessage` has no
meaning within HTTP/2, the argument will have no effect and a process warning