i want to get current weather information of coordinated base from openweathermap API. For this purpose i am using flutter's HTTP Package.
the problem is here when i use this method
One more problem is that... I got these coordinates on Memu App Player but does not gives on Real android device and Android Studio's Own Emulator.
void getWeatherData()async{
String url = 'http://api.openweathermap.org/data/2.5/weather?lat=35&lon=139&appid=331533c0cc2197e929ea79cdb2a70e33';
Response response = await get(Uri.parse(url));
print(response.body); }
this should give me API result completely but it gives me this error when i run my app.
Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://api.openweathermap.org/data/2.5/weather?lat=35&lon=139&appid=331533c0cc2197e929ea79cdb2a70e33
This is how I did it. I'm going through a course in Udemy that is going over what you are asking.
Remember to use