public class ApacheHttpClientHttpConnection extends Object implements HttpConnection
| Constructor and Description |
|---|
ApacheHttpClientHttpConnection(org.apache.hc.client5.http.classic.methods.HttpUriRequestBase request) |
| 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) |
public ApacheHttpClientHttpConnection(org.apache.hc.client5.http.classic.methods.HttpUriRequestBase request)
public void header(String key, String value)
header in interface HttpConnectionpublic void setConnectTimeoutMs(long connectTimeoutMs)
setConnectTimeoutMs in interface HttpConnectionpublic void setReadTimeoutMs(long readTimeoutMs)
setReadTimeoutMs in interface HttpConnectionpublic void output(Consumer<? super OutputStream> consumer, String contentType, Optional<String> contentEncoding, boolean chunked)
HttpConnectionoutput in interface HttpConnectionconsumer - action to be performed on the OutputStreamcontentType - Content-Type header valuecontentEncoding - if present is appended to the Content-Type valuepublic Response response() throws IOException
response in interface HttpConnectionIOExceptionpublic void close()
throws IOException
close in interface HttpConnectionIOExceptionCopyright © 2023. All rights reserved.