const data = {
name: "vasya",
age: 32
};
let xhr = new XMLHttpRequest();
xhr.open("POST", "/sign-in");
xhr.setRequestHeader("Content-type", "application/json");
xhr.onreadystatechange = function() {//Call a function when the state changes.
if(xhr.readyState == 4 && xhr.status == 200) {
console.log(xhr.responseText);
}
};
xhr.send(JSON.stringify(data));