0
Using the object XMLHttpRequest
javascript itself, would be as follows:
const xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
console.log(this.status); //Status Code
//Successfully
if (this.readyState == 4 && this.status == 200) {
//TODO
}
};
xhttp.open("POST", "ENDPOINT_API", true);
xhttp.send();