T
- the data typepublic class HttpMessageConverterExtractor<T> extends Object implements ResponseExtractor<T>
T
.RestTemplate
Constructor and Description |
---|
HttpMessageConverterExtractor(Class<T> responseType,
List<HttpMessageConverter<?>> messageConverters)
Create a new instance of the
HttpMessageConverterExtractor with the given response
type and message converters. |
HttpMessageConverterExtractor(Type responseType,
List<HttpMessageConverter<?>> messageConverters)
Creates a new instance of the
HttpMessageConverterExtractor with the given response
type and message converters. |
Modifier and Type | Method and Description |
---|---|
T |
extractData(ClientHttpResponse response)
Extract data from the given
ClientHttpResponse and return it. |
protected MediaType |
getContentType(ClientHttpResponse response)
Determine the Content-Type of the response based on the "Content-Type"
header or otherwise default to
MediaType.APPLICATION_OCTET_STREAM . |
public HttpMessageConverterExtractor(Class<T> responseType, List<HttpMessageConverter<?>> messageConverters)
HttpMessageConverterExtractor
with the given response
type and message converters. The given converters must support the response type.public HttpMessageConverterExtractor(Type responseType, List<HttpMessageConverter<?>> messageConverters)
HttpMessageConverterExtractor
with the given response
type and message converters. The given converters must support the response type.public T extractData(ClientHttpResponse response) throws IOException
ResponseExtractor
ClientHttpResponse
and return it.extractData
in interface ResponseExtractor<T>
response
- the HTTP responseIOException
- in case of I/O errorsprotected MediaType getContentType(ClientHttpResponse response)
MediaType.APPLICATION_OCTET_STREAM
.response
- the response