Modifier and Type | Class and Description |
---|---|
(package private) class |
Http2Codec.StreamFinishingSource |
Modifier and Type | Field and Description |
---|---|
private Interceptor.Chain |
chain |
private OkHttpClient |
client |
private Http2Connection |
connection |
private static okio.ByteString |
CONNECTION |
private static okio.ByteString |
ENCODING |
private static okio.ByteString |
HOST |
private static java.util.List<okio.ByteString> |
HTTP_2_SKIPPED_REQUEST_HEADERS
See http://tools.ietf.org/html/draft-ietf-httpbis-http2-09#section-8.1.3.
|
private static java.util.List<okio.ByteString> |
HTTP_2_SKIPPED_RESPONSE_HEADERS |
private static okio.ByteString |
KEEP_ALIVE |
private static okio.ByteString |
PROXY_CONNECTION |
private Http2Stream |
stream |
(package private) StreamAllocation |
streamAllocation |
private static okio.ByteString |
TE |
private static okio.ByteString |
TRANSFER_ENCODING |
private static okio.ByteString |
UPGRADE |
DISCARD_STREAM_TIMEOUT_MILLIS
Constructor and Description |
---|
Http2Codec(OkHttpClient client,
Interceptor.Chain chain,
StreamAllocation streamAllocation,
Http2Connection connection) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel this stream.
|
okio.Sink |
createRequestBody(Request request,
long contentLength)
Returns an output stream where the request body can be streamed.
|
void |
finishRequest()
Flush the request to the underlying socket and signal no more bytes will be transmitted.
|
void |
flushRequest()
Flush the request to the underlying socket.
|
static java.util.List<Header> |
http2HeadersList(Request request) |
ResponseBody |
openResponseBody(Response response)
Returns a stream that reads the response body.
|
static Response.Builder |
readHttp2HeadersList(java.util.List<Header> headerBlock)
Returns headers for a name value block containing an HTTP/2 response.
|
Response.Builder |
readResponseHeaders(boolean expectContinue)
Parses bytes of a response header from an HTTP transport.
|
void |
writeRequestHeaders(Request request)
This should update the HTTP engine's sentRequestMillis field.
|
private static final okio.ByteString CONNECTION
private static final okio.ByteString HOST
private static final okio.ByteString KEEP_ALIVE
private static final okio.ByteString PROXY_CONNECTION
private static final okio.ByteString TRANSFER_ENCODING
private static final okio.ByteString TE
private static final okio.ByteString ENCODING
private static final okio.ByteString UPGRADE
private static final java.util.List<okio.ByteString> HTTP_2_SKIPPED_REQUEST_HEADERS
private static final java.util.List<okio.ByteString> HTTP_2_SKIPPED_RESPONSE_HEADERS
private final OkHttpClient client
private final Interceptor.Chain chain
final StreamAllocation streamAllocation
private final Http2Connection connection
private Http2Stream stream
public Http2Codec(OkHttpClient client, Interceptor.Chain chain, StreamAllocation streamAllocation, Http2Connection connection)
public okio.Sink createRequestBody(Request request, long contentLength)
HttpCodec
createRequestBody
in interface HttpCodec
public void writeRequestHeaders(Request request) throws java.io.IOException
HttpCodec
writeRequestHeaders
in interface HttpCodec
java.io.IOException
public void flushRequest() throws java.io.IOException
HttpCodec
flushRequest
in interface HttpCodec
java.io.IOException
public void finishRequest() throws java.io.IOException
HttpCodec
finishRequest
in interface HttpCodec
java.io.IOException
public Response.Builder readResponseHeaders(boolean expectContinue) throws java.io.IOException
HttpCodec
readResponseHeaders
in interface HttpCodec
expectContinue
- true to return null if this is an intermediate response with a "100"
response code. Otherwise this method never returns null.java.io.IOException
public static Response.Builder readHttp2HeadersList(java.util.List<Header> headerBlock) throws java.io.IOException
java.io.IOException
public ResponseBody openResponseBody(Response response) throws java.io.IOException
HttpCodec
openResponseBody
in interface HttpCodec
java.io.IOException