response.createPushResponse(headers, callback)
headers
<HTTP/2 Headers Object> 描述标头的对象callback
<Function> 在http2stream.pushStream()
完成后调用,或者在尝试创建推送的Http2Stream
失败或被拒绝时调用,或者在调用http2stream.pushStream()
方法之前关闭Http2ServerRequest
的状态err
<Error>res
<http2.Http2ServerResponse> 新创建的Http2ServerResponse
对象
使用给定的标头调用 http2stream.pushStream()
,如果成功,则将给定的 Http2Stream
包装在新创建的 Http2ServerResponse
上作为回调参数。
当 Http2ServerRequest
关闭时,回调被调用,错误为 ERR_HTTP2_INVALID_STREAM
。
headers
<HTTP/2 Headers Object> An object describing the headerscallback
<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()
methoderr
<Error>res
<http2.Http2ServerResponse> The newly-createdHttp2ServerResponse
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
.