title: Issue with POST request with API oauth2 / return: error 415
body: <p>I have some issues with an API with oauth2 authentication.
  After I get the token, and I want to sent my POST request but it still gives me a 415 error (Unsupported Media Type). I'm sure my payload's fields are good because I tried with postman and it works, but I don't know if I have to JSON stringify the header (the payload I think, but I'm not sure at 100%). I run my code on  Google apps script so I thought the problem came from apps script, but I can get the token and send GET request on it.</p>
  <pre class="lang-js prettyprint-override"><code>    function post_pers() {
       var url = &quot;(my url)&quot;;
       var data = {
        &quot;id&quot;: 32,
        &quot;nom&quot;: &quot;apij&quot;,
        &quot;prenom&quot;: &quot;joseph&quot;,
        &quot;civiliteLongue&quot;: &quot;Monsieur&quot;,
        &quot;idTypePersonne&quot;: &quot;PERSTPHYSIQUE  &quot;,
        &quot;ligne1Adresse&quot;: &quot; &quot;,
        &quot;ligne2Adresse&quot;: &quot; &quot;,
        &quot;ligne3Adresse&quot;: &quot; &quot;,
        &quot;codePostal&quot;: &quot; &quot;,
        &quot;commune&quot;: &quot; &quot;,
        &quot;idPays&quot;: &quot;FR&quot;,
        &quot;iban&quot;: &quot; &quot;,
        &quot;bic&quot;: &quot; &quot;,
        &quot;titulaireCompte&quot;: &quot; &quot;,
        &quot;domiciliationBanque&quot;: &quot; &quot;,
        &quot;assujettiTva&quot;: true,
        &quot;mediaPrefere&quot;: &quot;Mail&quot;,
      }
      var payload = JSON.stringify(data);
      Logger.log(&quot;payload; &quot;+payload)
      Logger.log(&quot;data; &quot;+data)
       
       var header1 = {
      &quot;accept&quot;: &quot;application/json&quot;,
      &quot;authorization&quot;: &quot;Bearer (my access token)&quot;,
      &quot;content-type&quot;: &quot;application/json&quot;
      }
      var header = JSON.stringify(header1);
      Logger.log(&quot;header; &quot;+header)
      Logger.log(&quot;header1; &quot;+header1)
  
      var options = {
          &quot;method&quot;: &quot;POST&quot;,
          &quot;header&quot;: header,
          &quot;payload&quot;: payload
      }
       var response = UrlFetchApp.fetch(url, options);
       Logger.log(response)
        }
  </code></pre>