Created
March 1, 2019 03:56
-
-
Save mjm918/9e59c22f70eb547b4c2cbc2cb10ebdfa to your computer and use it in GitHub Desktop.
Xilnex sync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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