颤抖与python后端

时间:2020-08-10 07:33:01

标签: python api flutter nlp backend

我有一个基于python的网站,其中包含一个我想从Flutter中填写的表格。 此表单需要一个输入文本字段(获取请求) 当按下Submit时,它将基于python脚本生成输出(这是自然语言处理) 是否可以使用flutter连接到此网站并填写表格? 我曾尝试在Flutter中使用“ HTTP”包,但无法连接到表单 任何帮助将不胜感激 我尝试了以下方法:

    Future<String> sendQuery(query) async{
  final http.Response response = await http.get(
  'http://127.0.0.1:5000/getQuery/',
    headers: <String, String>{
      'Content-Type': 'application/json; charset=UTF-8',
    },
  );
}

1 个答案:

答案 0 :(得分:1)

您可以使用此插件导航到网站https://pub.dev/packages/url_launcher

 _launchURL() async {
  const url = 'https://flutter.dev';
  if (await canLaunch(url)) {
await launch(url);
 } else {
 throw 'Could not launch $url';
 }
}