AerisWeather

免费增值
Verified
通过 AerisWeather | 已更新 לפני 9 חודשים | Weather
人气

9.7 / 10

延迟

955ms

服务等级

100%

返回所有讨论

invalid_location response from Nodejs request

avatar
blitz555
לפני שנתיים

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 לפני שנתיים

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

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论
打分:5 - 投票:1