fetch(loginApi, {
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
Password: password,
UserName: username
})
})
.then(response => response.json())
.then(responseData => {
console.log(responseData); //// <--- getting error at this line
})
.catch(error => {
console.error(error);
});
Any idea how to solve it??? Thanks in advance.