public interface ExchangeCodec
Modifier and Type | Field and Description |
---|---|
static int |
DISCARD_STREAM_TIMEOUT_MILLIS
The timeout to use while discarding a stream of input data.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel this stream.
|
RealConnection |
connection()
Returns the connection that carries this codec.
|
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.
|
okio.Source |
openResponseBodySource(Response response) |
Response.Builder |
readResponseHeaders(boolean expectContinue)
Parses bytes of a response header from an HTTP transport.
|
long |
reportedContentLength(Response response) |
Headers |
trailers()
Returns the trailers after the HTTP response.
|
void |
writeRequestHeaders(Request request)
This should update the HTTP engine's sentRequestMillis field.
|
static final int DISCARD_STREAM_TIMEOUT_MILLIS
RealConnection connection()
okio.Sink createRequestBody(Request request, long contentLength) throws java.io.IOException
java.io.IOException
void writeRequestHeaders(Request request) throws java.io.IOException
java.io.IOException
void flushRequest() throws java.io.IOException
java.io.IOException
void finishRequest() throws java.io.IOException
java.io.IOException
@Nullable Response.Builder readResponseHeaders(boolean expectContinue) throws java.io.IOException
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
long reportedContentLength(Response response) throws java.io.IOException
java.io.IOException
okio.Source openResponseBodySource(Response response) throws java.io.IOException
java.io.IOException
Headers trailers() throws java.io.IOException
java.io.IOException
void cancel()