Skip to content

Instantly share code, notes, and snippets.

@nickgs
Created August 21, 2019 15:49
Show Gist options
  • Save nickgs/789280af04d42f5c306aaf9151318cd0 to your computer and use it in GitHub Desktop.
Save nickgs/789280af04d42f5c306aaf9151318cd0 to your computer and use it in GitHub Desktop.
ADC Product API Javascript Example
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://www.adctoday.com/api/v1/product/700-11ABK");
xhr.setRequestHeader("Accept", "*/*");
xhr.setRequestHeader("Cache-Control", "no-cache");
xhr.setRequestHeader("Host", "www.adctoday.com");
xhr.setRequestHeader("Accept-Encoding", "gzip, deflate");
xhr.setRequestHeader("Connection", "keep-alive");
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