Interface HttpConnection
- All Known Implementing Classes:
ApacheHttpClientHttpConnection,DefaultHttpConnection
public interface HttpConnection
Expected sequence of calls is (BNF):
header()* [outputStream()] [response()] [close()]
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidvoidoutput(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()voidsetConnectTimeoutMs(long connectTimeoutMs) voidsetReadTimeoutMs(long readTimeoutMs)
-
Method Details
-
header
-
setConnectTimeoutMs
void setConnectTimeoutMs(long connectTimeoutMs) -
setReadTimeoutMs
void setReadTimeoutMs(long readTimeoutMs) -
output
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).- Parameters:
consumer- action to be performed on the OutputStreamcontentType- Content-Type header valuecontentEncoding- if present is appended to the Content-Type value
-
response
- Throws:
IOException
-
close
- Throws:
IOException
-