Hi there, I am trying to login to backendless.com via REST api. Below is my code. On Fuse debug console I didn’t see anything, not even errors. Whenever I test via POSTMAN it response back. Anything wrong with parsing header or body?
function login_clicked()
{
fetch('http://api.backendless.com/v1/users/login',
{
method: 'POST',
headers: {
"application-id": authKeys.appID,
"secret-key": authKeys.appSecrete,
"Content-type": "application/json",
"application-type": "REST"
},
body: JSON.stringify({
"name":"admin",
"password":"admin123"
})
})
.then(function(result){
if(result.status !== 200){
console.log("Something went wrong" + result);
return ;
}
return result.json();
})
.then(function(responseObject){
console.log("------------");
console.log(JSON.stringify(responseObject));
console.log("**");
});
}