I\'m following the Flutter Networking/HTTP tutorial to do a GET request to a server running on my localhost:8000. Visiting my localhost via my browser works fine. My code lo
to find ip is ifconfig mac / linux
en0: flags=8863 mtu 1500
this one => inet 192.168.43.57 netmask 0xffffff00 broadcast 192.168.43.255
nd6 options=201
media: autoselect
status: active
start php
php -S 192.168.43.57:5000 index.php
than declare on future
Future getIsi()async{
final res = await new Dio().get('http://192.168.43.57:5000/lihat-isi');
print('res.data');
return res.data;
}
an result is
I/flutter ( 3250): [{"id":"1","judul":"asasa","gambar":"asa","ket":"asa"},{"id":"2","judul":"asasa","gambar":"asa","ket":"asa"},{"id":"3","judul":"asasa","gambar":"asa","ket":"asa"},{"id":"4","judul":"asasa","gambar":"asa","ket":"asa"}]