How can I change a Accept-Header of a Resttemplate to application/json ?
But the post header is allways:Code:RestTemplate restTemplate = new RestTemplate(); List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>(); converters.add(new MappingJacksonHttpMessageConverter()); converters.add(new StringHttpMessageConverter()); converters.add(new FormHttpMessageConverter()); restTemplate.setMessageConverters(converters); //parameters has type MultiValueMap<String, String> restTemplate.postForObject("http://localhost:8080/myrestapp/content", parameters, MultiValueMap.class);
POST /apponizer-be/oauth/token HTTP/1.1
Accept: application/x-www-form-urlencoded, multipart/form-data
Content-Type: application/json;charset=UTF-8
and my rest server responses with JSON. Depending on that I've got allways the following error:
The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers ()


Reply With Quote
