You are putting it in the wrong location.
console.log(Userpassword); // this ok
fetch('https://localhost:3000/api/usuario/login', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
userName: user,
Userpassword: password
})
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…