我在拍拍网上试了试.我try 使用http包将我创建的一个简单的fltter web应用程序连接到mysql数据库和localhost.但是,我没有收到从请求方法返回的任何数据.当我试图打印出snaphot.error
张时,我得到了这个:XMLHttpRequest error
.我在FutureBuilder()
号车里有这种方法.
getMethod()async{
String theUrl = 'https://localhost/fetchData.php';
var res = await http.get(Uri.encodeFull(theUrl),headers: {"Accept":"application/json"});
var responsBody = json.decode(res.body);
print(responsBody);
return responsBody;
}