This issue was resolved in Spring 3.2 https://jira.springsource.org/browse/SPR-7023 but it wasn't ported to spring for android. To clarify, it isn't possibile to do something like this at the moment using the version of RestTemplate in spring for android
It's possible in Spring 3.2Code:ResponseEntity<MyWrapper<SomeType>> response = restTemplate.exchange(...)
Is it possible to port the Spring 3.2 code as is to Android? or if not, what workaround could I use?Code:public <T> ResponseEntity<T> exchange(String url, HttpMethod method, HttpEntity<?> requestEntity, ParameterizedTypeReference<T> responseType, Map<String, ?> uriVariables) throws RestClientException { Type type = responseType.getType(); HttpEntityRequestCallback requestCallback = new HttpEntityRequestCallback(requestEntity, type); ResponseEntityResponseExtractor<T> responseExtractor = new ResponseEntityResponseExtractor<T>(type); return execute(url, method, requestCallback, responseExtractor, uriVariables); }


Reply With Quote