public interface PushObserver
HTTP/2
在客户端处理服务器发起的HTTP请求
返回true以请求取消已推的流。
注意,这并不保证将来的帧不会到达流ID| Modifier and Type | Field and Description |
|---|---|
static PushObserver |
CANCEL |
| Modifier and Type | Method and Description |
|---|---|
boolean |
onData(int streamId,
BufferSource source,
int byteCount,
boolean last)
与推送请求对应的响应数据块。必须读取或跳过这些数据.
|
boolean |
onHeaders(int streamId,
List<HttpHeaders> responseHeaders,
boolean last)
推送请求对应的响应标头。当
last为真时,则没有后续的数据帧 |
boolean |
onRequest(int streamId,
List<HttpHeaders> requestHeaders)
描述服务器打算为其推送响应的请求
|
void |
onReset(int streamId,
ErrorCode errorCode)
指示此流被取消的原因
|
static final PushObserver CANCEL
boolean onRequest(int streamId,
List<HttpHeaders> requestHeaders)
streamId - 务器发起的流ID:偶数requestHeaders - 最低限度包括、、和boolean onHeaders(int streamId,
List<HttpHeaders> responseHeaders,
boolean last)
last为真时,则没有后续的数据帧streamId - 服务器发起的流ID:偶数.responseHeaders - 最少包含last - 如果为真,则没有响应数据boolean onData(int streamId,
BufferSource source,
int byteCount,
boolean last)
throws IOException
streamId - 服务器发起的流ID:偶数.source - 与此流ID对应的数据的位置.byteCount - 从源读取或跳过的字节数.last - 如果为真,则不需要遵循任何数据帧.IOException - 异常void onReset(int streamId,
ErrorCode errorCode)
streamId - 服务器发起的流ID:偶数.errorCode - 错误码信息Copyright © 2019. All rights reserved.