public final class Http2xStream extends Objectimplements HttpStream
DISCARD_STREAM_TIMEOUT_MILLIS| Constructor and Description |
|---|
Http2xStream(StreamAllocation
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancel this stream.
|
okio |
createRequestBody(Request
Returns an output stream where the request body can be streamed.
|
void |
finishRequest()
Flush the request to the underlying socket.
|
static List |
http2HeadersList(Request
|
ResponseBody |
openResponseBody(Response
Returns a stream that reads the response body.
|
static Response |
readHttp2HeadersList(List
Returns headers for a name value block containing an HTTP/2 response.
|
Response |
readResponseHeaders()
Read and return response headers.
|
static Response |
readSpdy3HeadersList(List
Returns headers for a name value block containing a SPDY response.
|
void |
setHttpEngine(HttpEngine
|
static List |
spdy3HeadersList(Request
Returns a list of alternating names and values containing a SPDY request.
|
void |
writeRequestBody(RetryableSink
Sends the request body returned by
HttpStream to the remote peer.
|
void |
writeRequestHeaders(Request
This should update the HTTP engine's sentRequestMillis field.
|
public Http2xStream(StreamAllocationstreamAllocation, FramedConnection framedConnection)
public void setHttpEngine(HttpEnginehttpEngine)
public okio.Sink createRequestBody(Request request, long contentLength) throws IOException
HttpStream
createRequestBody in interface
HttpStream
IOException
public void writeRequestHeaders(Requestrequest) throws IOException
HttpStream
writeRequestHeaders in interface
HttpStream
IOException
public void writeRequestBody(RetryableSinkrequestBody) throws IOException
HttpStream
HttpStream.createRequestBody(okhttp3.Request, long) to the remote peer.
writeRequestBody in interface
HttpStream
IOException
public void finishRequest()
throws IOException
HttpStream
finishRequest in interface
HttpStream
IOException
public Response.Builder readResponseHeaders() throws IOException
HttpStream
readResponseHeaders in interface
HttpStream
IOException
public static List<Header > spdy3HeadersList(Request request)
public static Response.Builder readSpdy3HeadersList(List <Header > headerBlock) throws IOException
IOException
public static Response.Builder readHttp2HeadersList(List <Header > headerBlock) throws IOException
IOException
public ResponseBodyopenResponseBody(Response response) throws IOException
HttpStream
openResponseBody in interface
HttpStream
IOException
public void cancel()
HttpStream