AerisWeather

FREEMIUM
Verified
От AerisWeather | Обновлено 4 месяца назад | Weather
Популярность

9.6 / 10

Задержка

1,111ms

Уровень обслуживания

100%

Назад ко всем обсуждениям

invalid_location response from Nodejs request

avatar
blitz555
2 года назад

Hi,

I tested the entrypoint which worked fine. Then I copied the code snippet to my Node server code, it returned:
{"success":false,"error":{"code":"invalid_location","description":"The requested location was not found."},"response":[]}
Why does it do that? Am I missing something here?

Regards,

var request = require("request");

var options = {
  method: 'GET',
  url: 'https://aerisweather1.p.rapidapi.com/forecasts/cairo%252Ceg',
  headers: {
    'x-rapidapi-host': '...',
    'x-rapidapi-key': '...',
    useQueryString: true
  }
};

request(options, function (error, response, body) {
	if (error) throw new Error(error);

	console.log(body);
});

avatar
blitz555 commented 2 года назад

I found that the problem was with the hex character for comma in url. Works fine now.

Присоединяйтесь к обсуждению – добавьте комментарий ниже:

Войдите / Зарегистрируйтесь, чтобы публиковать новые комментарии
Оценки: 5 - Голосов: 1