public interface HttpConnection
header()* [outputStream()] [response()] [close()]
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
header(String key,
String value) |
void |
output(Consumer<? super OutputStream> consumer,
String contentType,
Optional<String> contentEncoding,
boolean chunked)
When a consumer is defined (when this method is called), this class is
expected to set the Content-Type and Content-Length fields (and support
chunking if requested).
|
Response |
response() |
void |
setConnectTimeoutMs(long connectTimeoutMs) |
void |
setReadTimeoutMs(long readTimeoutMs) |
void setConnectTimeoutMs(long connectTimeoutMs)
void setReadTimeoutMs(long readTimeoutMs)
void output(Consumer<? super OutputStream> consumer, String contentType, Optional<String> contentEncoding, boolean chunked)
consumer - action to be performed on the OutputStreamcontentType - Content-Type header valuecontentEncoding - if present is appended to the Content-Type valueResponse response() throws IOException
IOExceptionvoid close()
throws IOException
IOExceptionCopyright © 2023. All rights reserved.