flutter mobile(android emulator) http post doesn't reaches website
Solution 1
This helped me(the first answer, tiny hint for mac i hat to press show on disk in the AVD manager in android studio to get to the folder, else i couldn't find it): Emulator: emulator: ERROR: Running multiple emulators with the same AVD is an experimental feature
Solution 2
Can you access websites on a browser (e.g. Chrome) on the emulator?
I've always needed to start my emulator with the -dns switch, otherwise name resolution fails:
c:\AndroidSDK\emulator\emulator.exe -avd Android-28-Playstore-x64 -dns-server 8.8.8.8
Charles Down
Updated on December 27, 2022Comments
-
Charles Down over 1 year
My http.post request doesn't gives any answer on my mobile(android emulator) flutter. On the browser it gives the classic XMLHttpRequest error but thats not the topic.
final response = await http.post('https://www.notthewebsite.de/420/lalala.php', body: { "eMail": eMail.text, "password": password.text, }); var datauser = json.decode(response.body);
And it doesn't reaches the website because if it would call website it would insert something into a data base. But the insertion into the database works when i start the website manually.
Thx for any answer.