Interface ProxyResponse
-
- All Known Implementing Classes:
ProxyResponseImpl
public interface ProxyResponseRepresents an HTTP response from a proxy.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddContent(ByteBuffer contents)Adds contents to the body if it is missing content.ByteBuffergetContents()Gets the HTTP response body.StringgetError()Gets the HTTP response body as an error.Map<String,List<String>>getHeaders()Gets the headers for the HTTP response.HttpStatusLinegetStatus()Gets the HTTP status line.booleanhasConnectionCloseHeader()Checks if the HTTP response for CONNECT has a "Connection: close" header.booleanisMissingContent()Gets whether or not the HTTP response is complete.
-
-
-
Method Detail
-
getHeaders
Map<String,List<String>> getHeaders()
Gets the headers for the HTTP response.- Returns:
- The headers for the HTTP response.
-
getStatus
HttpStatusLine getStatus()
Gets the HTTP status line.- Returns:
- The HTTP status line.
-
getContents
ByteBuffer getContents()
Gets the HTTP response body.- Returns:
- The HTTP response body.
-
getError
String getError()
Gets the HTTP response body as an error.- Returns:
- If there is no HTTP response body, an empty string is returned.
-
isMissingContent
boolean isMissingContent()
Gets whether or not the HTTP response is complete. An HTTP response is complete when the HTTP header and body are received.- Returns:
trueif the HTTP response is complete, andfalseotherwise.
-
addContent
void addContent(ByteBuffer contents)
Adds contents to the body if it is missing content.- Parameters:
contents- Contents to add to the HTTP body.
-
hasConnectionCloseHeader
boolean hasConnectionCloseHeader()
Checks if the HTTP response for CONNECT has a "Connection: close" header.- Returns:
trueif the HTTP response has a "Connection: close" header, andfalseotherwise.
-
-