public interface FromServer
Adapter interface used to provide a bridge for response data between the HttpBuilder
API and the underlying client implementation.
Modifier and Type | Interface and Description |
---|---|
static class |
FromServer.Header<T>
Defines the interface to the HTTP headers contained in the response.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_CONTENT_TYPE |
Modifier and Type | Method and Description |
---|---|
void |
finish()
Performs any client-specific response finishing operations.
|
default java.nio.charset.Charset |
getCharset()
Retrieves the value of the charset from the "Content-Type" response header.
|
default java.lang.String |
getContentType()
Retrieves the value of the "Content-Type" header from the response.
|
default java.util.List<java.net.HttpCookie> |
getCookies() |
boolean |
getHasBody()
Determines whether or not there is body content in the response.
|
java.util.List<FromServer.Header<?>> |
getHeaders()
Retrieves a
List of the response headers as (FromServer.Header objects). |
java.io.InputStream |
getInputStream()
Retrieves the
InputStream containing the response content (may have already been processed). |
java.lang.String |
getMessage()
Retrieves the response status message.
|
default java.io.Reader |
getReader()
Retrieves a
Reader for the response body content (if there is any). |
int |
getStatusCode()
Retrieves the response status code (List of HTTP status code).
|
java.net.URI |
getUri()
Retrieves the
URI of the original request. |
static final java.lang.String DEFAULT_CONTENT_TYPE
default java.lang.String getContentType()
Retrieves the value of the "Content-Type" header from the response.
default java.nio.charset.Charset getCharset()
Retrieves the value of the charset from the "Content-Type" response header.
default java.util.List<java.net.HttpCookie> getCookies()
java.io.InputStream getInputStream()
Retrieves the InputStream
containing the response content (may have already been processed).
int getStatusCode()
Retrieves the response status code (List of HTTP status code).
java.lang.String getMessage()
Retrieves the response status message.
java.util.List<FromServer.Header<?>> getHeaders()
Retrieves a List
of the response headers as (FromServer.Header
objects).
List
of response headersboolean getHasBody()
Determines whether or not there is body content in the response.
java.net.URI getUri()
Retrieves the URI
of the original request.
URI
of the original requestvoid finish()
Performs any client-specific response finishing operations.
default java.io.Reader getReader()
Retrieves a Reader
for the response body content (if there is any). The content may have already been processed.
Reader
for the response body content (may be empty)