public interface ExchangeCodec
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DISCARD_STREAM_TIMEOUT_MILLIS
The timeout to use while discarding a stream of input data.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cancel()
Cancel this stream.
|
RealConnection |
connection()
Returns the connection that carries this codec.
|
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.
|
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()
Sink createRequestBody(Request request, long contentLength) throws IOException
IOExceptionvoid writeRequestHeaders(Request request) throws IOException
IOExceptionvoid flushRequest()
throws IOException
IOExceptionvoid finishRequest()
throws IOException
IOException@Nullable Response.Builder readResponseHeaders(boolean expectContinue) throws IOException
expectContinue - true to return null if this is an intermediate response with a "100"
response code. Otherwise this method never returns null.IOExceptionlong reportedContentLength(Response response) throws IOException
IOExceptionSource openResponseBodySource(Response response) throws IOException
IOExceptionHeaders trailers() throws IOException
IOExceptionvoid cancel()
Copyright © 2024. All rights reserved.