title: OAuth2RestTemplate adds charset into content type header
body: <p>When trying to get an access token using OAuth2RequestTemplate the call sends the below header in a request </p>
  
  <pre><code>"Content-Type", "application/x-www-form-urlencoded;charset=UTF-8”
  </code></pre>
  
  <p>I’d like to drop the charset to not be included there.</p>
  
  <p>I tried to set header value manually through AccessTokenRequest object and a CustomTokenProvider, but it did not work.</p>
  
  <p>Any idea why it is actually including it there and how to get rid of it.</p>
  
  <p>UPDATE : Including the code sample</p>
  
  <p><strong>OPTION 1 :</strong></p>
  
  <pre><code>String oauthServerUri = "..../access_token";
  
  ClientCredentialsResourceDetails ccDetails = new ClientCredentialsResourceDetails();
  ccDetails.setClientId("clientId");
  ccDetails.setClientSecret("clientSecret");
  ccDetails.setGrantType("client_credentials");
  ccDetails.setAccessTokenUri(oauthServerUri);
  
  AccessTokenRequest tokenRequest = new DefaultAccessTokenRequest();
  
  Map&lt;String, List&lt;String&gt;&gt; headers = new HashMap&lt;&gt;();
  headers.put("Content-Type", Arrays.asList("Some Proper Value"));
  tokenRequest.setHeaders(headers);
  OAuth2ClientContext context = new DefaultOAuth2ClientContext(tokenRequest);
  
  OAuth2RestTemplate restTemplate = new OAuth2RestTemplate(ccDetails, context);
  OAuth2AccessToken accessToken = restTemplate.getAccessToken();
  </code></pre>
  
  <p><strong>OPTION 2 :</strong>
  As an alternative I have tried the approach described here :
  <a href="https://stackoverflow.com/questions/44999532/how-to-set-http-header-for-oauth2resttemplate/51769621">How to set HTTP Header for OAuth2RestTemplate</a>
  Which is implementing <code>AccessTokenProvider</code> and setting headers in <code>obtainAccessToken</code>. But this did not help either.</p>