Class HttpMessageConverterExtractor<T>
java.lang.Object
org.springframework.web.client.HttpMessageConverterExtractor<T>
- Type Parameters:
- T- the data type
- All Implemented Interfaces:
- ResponseExtractor<T>
Response extractor that uses the given entity converters
 to convert the response into a type 
T.- Since:
- 3.0
- Author:
- Arjen Poutsma, Sam Brannen
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionHttpMessageConverterExtractor(Class<T> responseType, List<HttpMessageConverter<?>> messageConverters) Create a new instance of theHttpMessageConverterExtractorwith the given response type and message converters.HttpMessageConverterExtractor(Type responseType, List<HttpMessageConverter<?>> messageConverters) Creates a new instance of theHttpMessageConverterExtractorwith the given response type and message converters.
- 
Method SummaryModifier and TypeMethodDescriptionextractData(ClientHttpResponse response) Extract data from the givenClientHttpResponseand return it.protected MediaTypegetContentType(ClientHttpResponse response) Determine the Content-Type of the response based on the "Content-Type" header or otherwise default toMediaType.APPLICATION_OCTET_STREAM.
- 
Constructor Details- 
HttpMessageConverterExtractorpublic HttpMessageConverterExtractor(Class<T> responseType, List<HttpMessageConverter<?>> messageConverters) Create a new instance of theHttpMessageConverterExtractorwith the given response type and message converters. The given converters must support the response type.
- 
HttpMessageConverterExtractorpublic HttpMessageConverterExtractor(Type responseType, List<HttpMessageConverter<?>> messageConverters) Creates a new instance of theHttpMessageConverterExtractorwith the given response type and message converters. The given converters must support the response type.
 
- 
- 
Method Details- 
extractDataDescription copied from interface:ResponseExtractorExtract data from the givenClientHttpResponseand return it.- Specified by:
- extractDatain interface- ResponseExtractor<T>
- Parameters:
- response- the HTTP response
- Returns:
- the extracted data
- Throws:
- IOException- in case of I/O errors
 
- 
getContentTypeDetermine the Content-Type of the response based on the "Content-Type" header or otherwise default toMediaType.APPLICATION_OCTET_STREAM.- Parameters:
- response- the response
- Returns:
- the MediaType, or "application/octet-stream"
 
 
-