Я пытаюсь получить информацию о погоде, но когда я делаю простой почтовый запрос к API, я получаю этот результат.
`https://weather.api.here.com/weather/1.0/report.json?app_id=${appId}&app_code=${appCode}&product=observation&name=${city}`
{ Type: 'Invalid Request',
[0] Message:
[0] [ 'CW: City Information Required for product type::local_conditions' ] }
в документации "https://developer.here.com" не могу найти решение этой ошибки





Это должно быть довольно просто, приведенный ниже код работает для меня:
const request = require('request');
const options = {
method: 'GET',
url: 'https://weather.api.here.com/weather/1.0/report.json',
qs: {
app_id: appId, // Put your APP_ID here
app_code: appCode, // Put your APP_CODE here
product: 'observation',
name: 'Berlin' // Put whichever location here
}
}
request(options, (error, response, body) => {
if (error) {
console.error("An error has occurred: ", error);
} else {
console.info("Response body: ", body);
}
});