I understand that this is a typical error, but I cannoty figure out, where is the problem located? The link in browser opens normally with JSON structure, but in weatherRequest.json()
i even got an error Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
.
Help, please...
let fetchWeather = async () => {
const weatherRequest = await fetch(`api.openweathermap.org/data/2.5/forecast?q=München,DE&appid=my_key`);
const weatherStore = await weatherRequest.json();
console.log('weatherStore', weatherStore);
}
fetchWeather();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.