I\'m currently using an OAuth2RestOperations that extends the Spring RestTemplate and I would like to specify the content type header.
The only thing I\'ve managed to do
If you're using Spring Boot, you can just
@Configuration
public class RestConfig {
@Bean
public RestTemplate getRestTemplate() {
RestTemplate restTemplate = new RestTemplate();
restTemplate.setInterceptors(Collections.singletonList(new HttpHeaderInterceptor("Accept",
MediaType.APPLICATION_JSON.toString())));
return restTemplate;
}
}