AerisWeather

FREEMIUM
Verified
Durch AerisWeather | Aktualisiert vor 9 Monaten | Weather
Popularität

9.7 / 10

Latenz

954ms

Service Level

100%

Zurück zu allen Diskussionen

invalid_location response from Nodejs request

avatar
blitz555
vor 2 Jahren

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 vor 2 Jahren

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

Nehmen Sie an der Diskussion teil - fügen Sie unten einen Kommentar hinzu:

Anmelden / Registrieren, um neue Kommentare zu veröffentlichen
Bewertung: 5 - Stimmen: 1