Advertisement
Guest User

Untitled

a guest
Feb 6th, 2013
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement