Today, I was using the OpenWeatherMap API, and when I live tested it, with all the error handlings(if not error, if status = 200), and it gave back a status of 404. I pasted the URL of the WEB API inti my browser, and got a valid response.
Here’s my URL: http://api.openweathermap.org/data/2.5/weather?q=Bangalore&appid=MY_API_KEY
This is my valid JSON resposne:
{“coord”:{“lon”:77.6033,“lat”:12.9762},“weather”:[{“id”:800,“main”:“Clear”,“description”:“clear sky”,“icon”:“01d”}],“base”:“stations”,“main”:{“temp”:303.23,“feels_like”:296.71,“temp_min”:302.04,“temp_max”:304.15,“pressure”:1016,“humidity”:18},“visibility”:8000,“wind”:{“speed”:7.2,“deg”:70},“clouds”:{“all”:6},“dt”:1614756841,“sys”:{“type”:1,“id”:9205,“country”:“IN”,“sunrise”:1614733476,“sunset”:1614776330},“timezone”:19800,“id”:1277333,“name”:“Bengaluru”,“cod”:200}
That’s my debug method… It’s meant so that I have enough time to copy the URL from the input and paste it in my browser so I can check if anything’s wrong.
Edit@tatiang You were right! I didn’t add the https://. As soon as I did, it worked. I just copied whta they had on their site: