T
- Response entity expected typepublic interface ResponseEntity<T> extends HttpResponse<T>
HttpResponse
extension that adds HTTP entity handling, dealing with HTTP response body processing
and conversion into a supported Java type, besides the one expected as declared response type.HttpResponse.Builder<T>
ACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ACCEPT_RANGES, AGE, ALLOW, AUTHORIZATION, CACHE_CONTROL, CONNECTION, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_RANGE, CONTENT_TYPE, COOKIE, DATE, ETAG, EXPECT, EXPIRES, FROM, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_RANGE, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LINK, LOCATION, MAX_FORWARDS, ORIGIN, PRAGMA, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, RANGE, REFERER, RETRY_AFTER, SCHEME_BASIC, SCHEME_BEARER, SCHEME_DIGEST, SERVER, SET_COOKIE, TRAILER, TRANSFER_ENCODING, UPGRADE, USER_AGENT, VARY, VIA, WARNING, WWW_AUTHENTICATE
Modifier and Type | Method and Description |
---|---|
<E> Optional<E> |
as(Class<E> entityType)
Read the message entity as an instance of specified type.
|
<E> Optional<E> |
as(ResponseType<E> entityType)
Read the message entity as an instance of specified type, using a
ResponseType representation to allow
generic types support. |
void |
close()
If supported by the underlying implementation, close the message entity input stream (if available and open) as
well as releases any other resources associated with the response.
|
builder, builder, getStatus, getStatusCode
getProtocol
getPayload, getPayloadType
getAuthorizationBasicCredentials, getAuthorizationBearer, getContentLength, getDate, getHeaderValue, getLocale, getLocales, getLocation
getHeader, getHeaders
<E> Optional<E> as(Class<E> entityType)
E
- Entity instance typeentityType
- Entity type (not null)HttpEntityProcessingException
- If the content of the message cannot be mapped to an entity of the
requested type<E> Optional<E> as(ResponseType<E> entityType)
ResponseType
representation to allow
generic types support.E
- Entity instance typeentityType
- Entity response type (not null)HttpEntityProcessingException
- If the content of the message cannot be mapped to an entity of the
requested typevoid close()
HttpEntityProcessingException
- If there is an error closing the responseCopyright © 2018 The Holon Platform. All rights reserved.