JSFiddle - React, Tailwind, and code Playground
by ronpearl
HTML
<div id="tester"></div>
JavaScript
var xhr = new XMLHttpRequest();
xhr.open("POST", "https://tsgolfapi.azurewebsites.net/api/gettoken", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
document.getElementById("tester").innerHTML = xhr.responseText;
}
}
xhr.send({
grant_type: 'password',
username: 'BIGFISH',
password: '49b69e42dc'
});