fetch POST is returning HTTP 415, while curl goes on fine and returns result
问题 This is what my code looks like 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); }) In Chrome, this is what I see I tried to do this by curl command and this is what