I've been struggling for a bit of time on this weird issue.
I am basically running the following GET request: https://maps.googleapis.com/maps/api/place/details/json?key=AIzaSyAqrDaQOszbVjKgK9YJQzfkVOXFEOLJH1Y&placeid=ChIJYWzsQuNRqEcRTmcQwwzoPGw
Works fine if I run on my browser directly or on Postman. Fails when running with javascript or Jquery. See fiddle here: https://jsfiddle.net/luron01/4L86x30c/2/
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
xmlhttp.responseText;
}
}
xmlhttp.open("GET", 'https://maps.googleapis.com/maps/api/place/details/json?key=AIzaSyAqrDaQOszbVjKgK9YJQzfkVOXFEOLJH1Y&placeid=ChIJYWzsQuNRqEcRTmcQwwzoPGw', true );
xmlhttp.send();
console.log(xmlhttp.responseText)
I believe I have all necessary APIs enabled (Google Places API Web,Service (Private API), Google Maps JavaScript API,Google Maps Geolocation API).
Any hint would be really great! Thanks