This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 6th, 2013  |  syntax: None  |  size: 0.65 KB  |  views: 42  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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.     }
clone this paste RAW Paste Data