Skip to content

Instantly share code, notes, and snippets.

@mjm918
Created March 1, 2019 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjm918/9e59c22f70eb547b4c2cbc2cb10ebdfa to your computer and use it in GitHub Desktop.
Save mjm918/9e59c22f70eb547b4c2cbc2cb10ebdfa to your computer and use it in GitHub Desktop.
Xilnex sync
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(JSON.stringify(this.responseText));
}
};
xhttp.open("GET", "LINK_TO_EASYTECH_API?auth=TOKEN", true);
xhttp.send();
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, "LINK_TO_EASYTECH_API?auth=TOKEN");
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$result = json_decode($response, true);
$info = curl_getinfo($ch);
$error = curl_error($ch);
curl_close($ch);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment