public final class Http1Codec extends Object implements HttpCodec
chunked.
Exchanges that do not have a request body may skip creating and closing the request body.
Exchanges that do not have a response body can call newFixedLengthSource(0) and may skip reading and closing that source.
DISCARD_STREAM_TIMEOUT_MILLIS| Constructor and Description |
|---|
Http1Codec(Client client,
StreamAllocation streamAllocation,
BufferedSource source,
BufferedSink sink) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
Sink |
createRequestBody(Request request,
long contentLength) |
void |
finishRequest() |
void |
flushRequest() |
boolean |
isClosed() |
Sink |
newChunkedSink() |
Source |
newChunkedSource(Url url) |
Sink |
newFixedLengthSink(long contentLength) |
Source |
newFixedLengthSource(long length) |
Source |
newUnknownLengthSource() |
ResponseBody |
openResponseBody(Response response) |
Headers |
readHeaders() |
Response.Builder |
readResponseHeaders(boolean expectContinue) |
void |
writeRequest(Headers headers,
String requestLine) |
void |
writeRequestHeaders(Request request) |
public Http1Codec(Client client, StreamAllocation streamAllocation, BufferedSource source, BufferedSink sink)
public Sink createRequestBody(Request request, long contentLength)
createRequestBody in interface HttpCodecpublic void writeRequestHeaders(Request request) throws IOException
writeRequestHeaders in interface HttpCodecIOExceptionpublic ResponseBody openResponseBody(Response response) throws IOException
openResponseBody in interface HttpCodecIOExceptionpublic boolean isClosed()
public void flushRequest()
throws IOException
flushRequest in interface HttpCodecIOExceptionpublic void finishRequest()
throws IOException
finishRequest in interface HttpCodecIOExceptionpublic void writeRequest(Headers headers, String requestLine) throws IOException
IOExceptionpublic Response.Builder readResponseHeaders(boolean expectContinue) throws IOException
readResponseHeaders in interface HttpCodecIOExceptionpublic Headers readHeaders() throws IOException
IOExceptionpublic Sink newChunkedSink()
public Sink newFixedLengthSink(long contentLength)
public Source newFixedLengthSource(long length) throws IOException
IOExceptionpublic Source newChunkedSource(Url url) throws IOException
IOExceptionpublic Source newUnknownLengthSource() throws IOException
IOExceptionCopyright © 2019. All rights reserved.