Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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]
- @RestService
- RestClient restClient;
- ...
- String json = "{"param":3}";
- restClient.getRestTemplate().getMessageConverters().add(new GsonHttpMessageConverter());
- Response res = restClient.send(json);
- @Rest("http://my-url.com")
- public interface RestClient
- {
- @Post("/something/")
- Response send(String json);
- RestTemplate getRestTemplate();
- void setRestTemplate(RestTemplate restTemplate);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement