AerisWeather

FREEMIUM
Verified
Door AerisWeather | Bijgewerkt 9 महीने पहले | Weather
Populariteit

9.7 / 10

Latency

955ms

Serviceniveau

100%

Terug naar alle discussies

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.

Doe mee aan de discussie - voeg hieronder een opmerking toe

Log in / Schrij u in om nieuwe opmerkingen te plaatsen
Beoordeling: 5 - Stemmen: 1