Charles Down
Charles Down

Reputation: 537

flutter mobile(android emulator) http post doesn't reaches website

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.

Upvotes: 2

Views: 804

Answers (2)

Charles Down
Charles Down

Reputation: 537

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

Upvotes: 0

Nick Fisher
Nick Fisher

Reputation: 755

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 

Upvotes: 1

Related Questions