title: Spring RestTemplate not working
body: <p>I have created application in Spring using RestTemplate, Using Rest-Template I am consuming an external webservice which is having a header as Accept as "application/json". In my Rest-Template I have added the header but still it is giveing me the following exception</p>
  
  <pre><code>org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [class com.site.Employee] and content type [application/octet-stream]
  </code></pre>
  
  <p>My code is as given below</p>
  
  <pre><code>    private static String BASE_URI = "http://localhost:8181/test/employee"
  
      final HttpHeaders requestHeaders = new HttpHeaders();
      requestHeaders.setAccept(Collections.singletonList(new MediaType("application", "json")));
      requestHeaders.setContentType(new MediaType("application", "json"));
      final HttpEntity&lt;?&gt; requestEntity = new HttpEntity&lt;Object&gt;(requestHeaders);
  
      final RestTemplate restTemplate = new RestTemplate();
  
      restTemplate.getMessageConverters().add(new MappingJackson2HttpMessageConverter());
      restTemplate.getMessageConverters().add(new StringHttpMessageConverter());
  
      final ResponseEntity&lt;Employee&gt; responseEntity = restTemplate.exchange(BASE_URI, HttpMethod.GET, requestEntity, Employee.class);
  </code></pre>
  
  <p>Can anyone please tell me some solution for this</p>
  
  <p><strong>Update 1</strong></p>
  
  <p>When I tries the below code, it is working fine</p>
  
  <pre><code>final ResponseEntity&lt;String&gt; responseEntity = restTemplate.exchange(BASE_URI, HttpMethod.GET, requestEntity, String.class);
  Employee employee = new ObjectMapper().readValue(responseEntity.getBody(), Employee.class);
  </code></pre>