I'm trying to retrieve the raw-reponse from a Spring RestTemplate
String get = restTemplate.postForObject(url, params, String.class);
But since the server responds with Content-Type: Application/Json Spring tries to map the Response to a String-Object by parsing it. Which leads in my case to
Cannot deserialize instance of `java.lang.String` out of START_ARRAY token
since the response contains a json array. Is it possible to get the raw response without parsing? Or do i have to use something other than the RestTemplate?
You can try the problem with these examples
restTemplate.getForEntity("https://api.github.com/users/hadley/orgs", String.class);
restTemplate.getForObject("https://api.github.com/users/hadley/orgs", String.class);