window.PostConsentAsync = (requesturi, body) => { var httpRequest = new XMLHttpRequest(); httpRequest.open('POST', requesturi, false); httpRequest.setRequestHeader("Content-type", "application/json");; httpRequest.onreadystatechange = function () { if (httpRequest.readyState == 4 && httpRequest.status == 200) { var value = JSON.parse(httpRequest.responseText); if (value.status == 'SUCCESS') { window.location = value.result; } } }; httpRequest.send(JSON.stringify(body)); return false; }; window.GetContextAsync = (requesturi) => { var httpRequest = new XMLHttpRequest(); httpRequest.open('GET', requesturi, false); var value; httpRequest.onreadystatechange = function () { if (httpRequest.readyState == 4 && httpRequest.status == 200) { value = JSON.parse(httpRequest.responseText); } }; httpRequest.send(); return value; }; window.GetErrorAsync = (requesturi) => { var httpRequest = new XMLHttpRequest(); httpRequest.open('GET', requesturi, false); var value; httpRequest.onreadystatechange = function () { if (httpRequest.readyState == 4 && httpRequest.status == 200) { value = JSON.parse(httpRequest.responseText); } }; httpRequest.send(); return value; }; window.PostLogInAsync = (requesturi, body) => { var httpRequest = new XMLHttpRequest(); httpRequest.open('POST', requesturi, false); httpRequest.setRequestHeader("Content-type", "application/json");; var value; httpRequest.onreadystatechange = function () { if (httpRequest.readyState == 4 && httpRequest.status == 200) { value = JSON.parse(httpRequest.responseText); console.log(value) } }; httpRequest.send(JSON.stringify(body)); return value; }; window.LocationAsync = (requesturi) => { window.location = requesturi; }; window.GetLogOutAsync = (requesturi) => { var httpRequest = new XMLHttpRequest(); httpRequest.open('GET', requesturi, false); var value; httpRequest.onreadystatechange = function () { if (httpRequest.readyState == 4 && httpRequest.status == 200) { value = JSON.parse(httpRequest.responseText); } }; httpRequest.send(); return value; };