JSFiddle - React, Tailwind, and code Playground
by sandfresh
JavaScript
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
console.log(xhr.readyState);
if(xhr.readyState == 4 && xhr.status == 200) {
console.log("success");
}
}
xhr.onerror= (e)=>{
console.log("error");
}
xhr.open("GET", "http://postman-echo.com/get");
xhr.setRequestHeader("Content-Type", "application\/x-www-form-urlencoded");
xhr.send();