Skip to content

Instantly share code, notes, and snippets.

@raihanba13
Created November 16, 2019 15:07
Show Gist options
  • Save raihanba13/99110cb36160e7a0fd85f774cd934e13 to your computer and use it in GitHub Desktop.
Save raihanba13/99110cb36160e7a0fd85f774cd934e13 to your computer and use it in GitHub Desktop.
var data = JSON.stringify({
"method": "Authenticate",
"params": {
"database": "database",
"userName": "[email protected]",
"password": "password"
}
});
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://my.geotab.com/apiv1");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.send(data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment