SHARE
TWEET

Untitled

a guest Feb 6th, 2013 80 Never
  1. org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [com.package.Response] and content type [application/octet-stream]
  2.        
  3. @RestService
  4.     RestClient restClient;
  5. ...
  6.     String json = "{"param":3}";
  7.     restClient.getRestTemplate().getMessageConverters().add(new GsonHttpMessageConverter());
  8.     Response res = restClient.send(json);
  9.        
  10. @Rest("http://my-url.com")
  11.  
  12.     public interface RestClient
  13.     {
  14.         @Post("/something/")
  15.         Response send(String json);
  16.  
  17.         RestTemplate getRestTemplate();
  18.  
  19.         void setRestTemplate(RestTemplate restTemplate);
  20.     }
RAW Paste Data
Top