Flutter Http Post Fails Connection Blocked From Android Emulator On Windows 10
my Flutter code looks like : var url = 'http://localhost:49912/api/Account/Register'; http .post(url, headers: {'Content-Type': 'application/json'}, body: js) .then
Solution 1:
finally figured it out as tried calling my service using 127.0.0.1 from Postman and got the same bad request. turnsout IIS Express is listening on localhost so needs to be convinced to listen on 127.0.0.1 by editing the
applicationhost.config file in the .vs folder in your solution. add the following line <binding protocol="http" bindingInformation="*:49912:127.0.0.1" />
Solution 2:
The most possible resolution for the error maybe
Try http://192.168.43.84:49912/api/Account/Register
Instead of http://localhost:49912/api/Account/Register
localhost must be replaced with your system ip address
for getting system ip simply go to cmd and type ipconfig
Post a Comment for "Flutter Http Post Fails Connection Blocked From Android Emulator On Windows 10"