我将使用openweathermap制作一个显示本地天气的web应用程序。当我单击该按钮时,会调用一个IP来获取我的位置(经度和纬度)的协调。然后将这些信息与API键(我在网站openweathermap.org中注册)一起使用,以创建APIdocs来调用天气信息,然后使用从服务器获得的数据更改APIdocs元素。我做这个。var lat = data.lat; var apiKey = "[APIKEY]";
var url = 'http:&
我有一个非常基本的用Spring制作的OpenWeathermap应用程序,当找不到城市时,OpenWeathermap返回{"cod":"404","message":"city not found"template = new RestTemplate();
ResponseEntity<Object> response = template.getForEntity("https://api
{ var city = event.target.elements.city.value;
const api_url= await fetch(`https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${API_KEY}&units=metric`);
const data =