summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
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