Getting 404 even when the link works JSON : <p>I'm trying to use OpenWeatherMap and get the JSON for the weather.
In the console i see 404 message, but when i visit the url manually it gives me the correct JSON</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var latitude;
var longitude;
var apiId = "c440e3f473378f9705827ed71efe5dcc";
var request = new XMLHttpRequest();

function getLocation() {

  if (navigator.geolocation) {

    navigator.geolocation.getCurrentPosition(function getPosition(position) {
      latitude = position.coords.latitude;
      longitude = position.coords.longitude;
      getJson();
    });

  } else {
    alert('Geo location not working or not supported by your browser.');
  }

}

function getJson() {

  request.open('GET', "api.openweathermap.org/data/2.5/weather?lat=" + latitude + "&amp;lon=" + longitude + "&amp;APPID=" + apiId + "");

  request.onload = function(data) {
    console.log(data);
  };

  request.send();

}
getLocation();</code></pre>
</div>
</div>
</p>
