i have a problem on my angular app :
i have a Curl request that work fine in my terminal :
curl -d "grant_type=password&client_id=IDXXXXXX&client_secret=SECRET&username=USERNAME&password=PASSWORD" https://MYINSTANCE/oauth_token.do
now i want to use it with angular JS.
here's what i tried :
var getDatas = {
grant_type: "password",
client_id: "ID",
client_secret : "PASS",
username : "USER",
password : "PASSWORD"
}
$http({
method: 'GET',
url: 'https://MYINSTANCE/oauth_token.do',
data : JSON.stringify(getDatas)
}).then(function successCallback(response) {
alert("response : " + response);
}, function errorCallback(response) {
alert("error : " + response);
});
But the service returns me Error.
I'm a noob on Curl requests with angular, someone can give me some advices?
Thx a lot!
Regards
application/x-www-form-urlencodedcontent-type, not JSON