diff --git a/doc/api/http2.md b/doc/api/http2.md index ed96c719f9a462..b47afdf1e95f48 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -3234,6 +3234,25 @@ deprecated: v13.0.0 See [`response.socket`][]. +#### `response.createPushResponse(headers, callback)` + + +* `headers` {HTTP/2 Headers Object} An object describing the headers +* `callback` {Function} Called once `http2stream.pushStream()` is finished, + or either when the attempt to create the pushed `Http2Stream` has failed or + has been rejected, or the state of `Http2ServerRequest` is closed prior to + calling the `http2stream.pushStream()` method + * `err` {Error} + * `res` {http2.Http2ServerResponse} The newly-created `Http2ServerResponse` + object + +Call [`http2stream.pushStream()`][] with the given headers, and wrap the +given [`Http2Stream`][] on a newly created `Http2ServerResponse` as the callback +parameter if successful. When `Http2ServerRequest` is closed, the callback is +called with an error `ERR_HTTP2_INVALID_STREAM`. + #### `response.end([data[, encoding]][, callback])` - -* `headers` {HTTP/2 Headers Object} An object describing the headers -* `callback` {Function} Called once `http2stream.pushStream()` is finished, - or either when the attempt to create the pushed `Http2Stream` has failed or - has been rejected, or the state of `Http2ServerRequest` is closed prior to - calling the `http2stream.pushStream()` method - * `err` {Error} - * `res` {http2.Http2ServerResponse} The newly-created `Http2ServerResponse` - object - -Call [`http2stream.pushStream()`][] with the given headers, and wrap the -given [`Http2Stream`][] on a newly created `Http2ServerResponse` as the callback -parameter if successful. When `Http2ServerRequest` is closed, the callback is -called with an error `ERR_HTTP2_INVALID_STREAM`. - ## Collecting HTTP/2 performance metrics The [Performance Observer][] API can be used to collect basic performance