Skip to content

Instantly share code, notes, and snippets.

@mjm918
Last active March 1, 2019 03:47
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/5f3e05ee4c151b1ca292e869982feec7 to your computer and use it in GitHub Desktop.
Save mjm918/5f3e05ee4c151b1ca292e869982feec7 to your computer and use it in GitHub Desktop.
Vimigo Code Samples
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, "LINK_TO_EASYTECH_API?date_from=2019-01-10&date_to=2019-02-22&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);
?>
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?date_from=2019-01-10&date_to=2019-02-22&auth=TOKEN", true);
xhttp.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment