189
rated 0 times
[
196]
[
7]
/ answers: 1 / hits: 26652
/ 6 Years ago, sat, february 24, 2018, 12:00:00
I am trying to sent an HTTP request with Axios, but I get a 404 error. The reason is that the request gets sent with the local host IP at the beginning of the URL, why is this happening?
JS:
function getWeather() {
axios.get('api.openweathermap.org/data/2.5/weather', {
params: {
lat: 30.18,
lon: 30.87,
appid: '57d9478bc08bc211f405f45b93b79272'
}
})
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log(error);
})
};
getWeather();
ERROR:
http://127.0.0.1:5500/api.openweathermap.org/data/2.5/weather?lat=30.18&lon=30.87&appid=57d9478b#####################3b79272 404 (Not Found)
More From » http