0

I have app with flutter . I have to connect to server my ip is like =https://91.#.#.#:5000/api when i post data to server i get flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: SocketException: OS Error: Connection refused, errno =111,address =server ip, port = 33450 my code var url = Uri.parse(AddressController.text); http.Response response = await http.post(url, body: {});

1 Answer 1

0

SocketException usually occurs when you don't have internet please make user that you have internet, if you're testing in real device make sure you put internet permission in manifest

Sign up to request clarification or add additional context in comments.

3 Comments

internet permission is in mainfest and I have flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: SocketException: OS Error: Connection refused, errno =111,address =server ip, port = 33450 my code var url = Uri.parse(AddressController.text); http.Response response = await http.post(url, body: {});
can you use URL instead of IP Address
no. i should to use ip address

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.