title: fetch POST is returning HTTP 415, while curl goes on fine and returns result
body: <p>This is what my code looks like</p>
  
  <pre><code>let body = {
              authCode: "XXXX",
              clientId: "YYYYYY",
              clientSecret: "ZZZZZZ"
          };
  
  
          fetch('https://api.myapp.com/oauth/token',{
              method: "POST",
              headers: {
                  "Content-Type": "application/json",
                  "Accept": "application/json"
              },
              mode: 'no-cors',
              body: body
          }).then(function(response){
              console.log("response: ", response);
          }).catch(function(error){
              console.log("could not get tokens: ", error);
          })
  </code></pre>
  
  <p>In Chrome, this is what I see
  <a href="https://i.stack.imgur.com/hMHKY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hMHKY.png" alt="enter image description here"></a></p>
  
  <p>I tried to do this by <code>curl command</code> and this is what it looks like  </p>
  
  <pre><code>➜  ~ curl -X POST -H "Content-Type: application/json" -d '{
    "authCode": "XXXX",
    "clientId": "YYYYY",
    "clientSecret": "ZZZZZZZZ"
  }' https://api.myapp.com/oauth/token
  {"authToken":"e141kjhkwr3432ca9b3d2128385ad91db4cd2:cca6b151-cab4-4de2-81db-9a739a62ae88:23000000"}
  </code></pre>
  
  <p>What am I doing wrong here?</p>
  
  <p><strong>UPDATE</strong>  </p>
  
  <p>After changing it to following, the result is still <code>HTTP 415</code> </p>
  
  <pre><code>fetch('https://api.myapp.com/oauth/token',{
              method: "POST",
              headers: {
                  "Content-Type": "application/json",
                  "Accept": "application/json"
              },
              mode: 'no-cors',
              body: JSON.stringify(body)
          }).then(function(response){
              console.log("response: ", response);
          }).catch(function(error){
              console.log("could not get tokens: ", error);
          })
  </code></pre>
  
  <p>Interestingly, I realized that I sent the header <code>"Content-Type": "application/json"</code> while what I get back is <code>content-type: text/plain</code>, why that might be happening?</p>
  
  <p><a href="https://i.stack.imgur.com/Ym6D4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Ym6D4.png" alt="enter image description here"></a></p>