hi everyone, i am trying to call an api, and the content type is application/x-www-form-urlencoded, the response returns False with an error :
{“error”:“unsupported_grant_type”}
I tested it in postman and it works just fine!
this is how i call it:
fetch("http://example.example.com/token", {
method: 'POST',
headers: {"Content-Type": "application/x-www-form-urlencoded"},
body: JSON.stringify(myData)
}).then(function(response) {
status = response.status;
response_ok = response.ok;
console.log(response.ok);
return response.json();
}).then(function(dataObject) {
// }).catch(function(err) {
});
and that’s what i get:
{"error":"unsupported_grant_type"}