title: Set default content type header of Spring RestTemplate
body: <p>I'm currently using an OAuth2RestOperations that extends the Spring RestTemplate and I would like to specify the content type header.</p>
  
  <p>The only thing I've managed to do was to explicitly set my header during the request: </p>
  
  <pre><code>public String getResult() {
      String result = myRestTemplate.exchange(uri, HttpMethod.GET, generateJsonHeader(), String.class).getBody();
  }
  
  private HttpEntity&lt;String&gt; generateJsonHeader() {
      HttpHeaders headers = new HttpHeaders();
      headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
      return new HttpEntity&lt;&gt;("parameters", headers);
  }
  </code></pre>
  
  <p>But it would actually be great to be able to set that once and for all during the bean initialization, and directly use the getforObject method instead of exchange.</p>