Home > Software design >  connect real decvice to localhost
connect real decvice to localhost

Time:08-27

i want to connect my real device to localhost to post and get data from api

var url = Uri.parse("http://192.168.1.13:3000/api/signup");
var response = await http.post(
  url,
  body: json.encode({
    "name": user.name,
    "email": user.email,
    "password": user.password,
    "address": user.address,
    "type": user.type,
    "_id": user.id,
    "__v": user.v,
  }),


);

when i press signup he gives me nothing and no errors appears I'm using my ipv4 address

CodePudding user response:

did you give internet permission to your app? like this

<manifest xmlns:android="...">
 <uses-permission android:name="android.permission.INTERNET"/> <!-- Add 
 this -->
</manifest>

CodePudding user response:

Make sure your Mobile device and Development Machine are in same network.

  • Related