Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

API Request error 404

Tom Jun 02, 2019 11:27PM BST

Hi,

I request city temperature with my nodejs script

https.get('https://api.openweathermap.org/data/2.5/weather?q=' + city + '&units=metric&appid=APPKEY'

If city contain accent (é, è, ï), my script return error 404, exemple with "Orléans"

However my console.log read corretly 'https://api.openweathermap.org/data/2.5/weather?q=orléans&units=metric&appid=APPKEY'

Any solution for my error ?
Regards

Up 0 rated Down
TOM Jun 04, 2019 01:30AM BST
Fixed with encodeURI() & decodeURI() for city variable

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
9eda11838f597e7a95b6a1c991dcae0a@openweathermap.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete