public interface HttpConnection
Modifier and Type | Interface and Description |
---|---|
static interface |
HttpConnection.RequestBodyDelegate
Delegate called when the body is ready to be written.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connection and frees all the allocated resources.
|
ServerResponse |
getResponse(HttpConnection.RequestBodyDelegate delegate)
Gets the server response.
|
HttpConnection |
setHeaders(List<NameValue> requestHeaders)
Set request headers.
|
HttpConnection |
setTotalBodyBytes(long totalBodyBytes,
boolean isFixedLengthStreamingMode)
Sets the total body bytes.
|
HttpConnection setHeaders(List<NameValue> requestHeaders) throws IOException
requestHeaders
- request headers to setIOException
- if an error occurs while setting request headersHttpConnection setTotalBodyBytes(long totalBodyBytes, boolean isFixedLengthStreamingMode)
totalBodyBytes
- total number of bytesisFixedLengthStreamingMode
- true if the fixed length streaming mode must be used. If
it's false, chunked streaming mode has to be usedServerResponse getResponse(HttpConnection.RequestBodyDelegate delegate) throws IOException
delegate
- delegate which handles the writing of the request bodyIOException
- if an error occurs while getting the server responsevoid close()