Skip to content
Advertisement

error 401 : unauthorized, received even after using API key while using www.openweathermap.org

Hi I am buliding my first web app using javascript and fetching data using API from www.openweathermap.org/ I have used the API key as mentioned in the documentation still it is giving an error of unauthorization. Can there be any other reason for this error while calling a function or so . Thank you in advance.

JavaScript

Advertisement

Answer

It’s the spaces near the equal signs in your URL. It’s likely urlencoding the space and sending your parameter as APPID%20 which is not being recognized as valid.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement