response.createPushResponse(headers, callback)
-
headers
<HTTP/2 Headers Object> 描述标头的对象¥
headers
<HTTP/2 Headers Object> An object describing the headers -
callback
<Function> 在http2stream.pushStream()
完成后调用,或者在尝试创建推送的Http2Stream
失败或被拒绝时调用,或者在调用http2stream.pushStream()
方法之前关闭Http2ServerRequest
的状态¥
callback
<Function> Called oncehttp2stream.pushStream()
is finished, or either when the attempt to create the pushedHttp2Stream
has failed or has been rejected, or the state ofHttp2ServerRequest
is closed prior to calling thehttp2stream.pushStream()
method-
err
<Error> -
res
<http2.Http2ServerResponse> 新创建的Http2ServerResponse
对象¥
res
<http2.Http2ServerResponse> The newly-createdHttp2ServerResponse
object
-
使用给定的标头调用 http2stream.pushStream()
,如果成功,则将给定的 Http2Stream
封装在新创建的 Http2ServerResponse
上作为回调参数。当 Http2ServerRequest
关闭时,回调被调用,错误为 ERR_HTTP2_INVALID_STREAM
。
¥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
.