I want to make a request to a public colour analysis API:
If I put this URL into Chrome's address bar, I get a JSON object returned after about 10 secs, however when making the request from Node , I only ever get an ESOCKETTIMEDOUT error.
request.get({
uri: 'http://mkweb.bcgsc.ca/color-summarizer?url=http://www.undistraction.com/vangogh/images/fisherman_s_wife_on_the_beach-8.jpg&precision=vlow&num_clusters=7&json=1&histogram=0&pixel=0',
timeout: 60000,
})
.on('error', (error) => {
console.log(error); // ESOCKETTIMEDOUT
})
.on('finish', (body) => {
// Happy place
});
What could be causing this error?