首页 > 解决方案 > Flutter POST Http,其中包含命令

问题描述

你好 Stackoverflow 社区。

我想在颤动中发布以下 Http 调用。

http://192.168.***.*:***/MobilSchnittstelle.html?cmd=XamServerDate

我已经找到了这个解决方案,但它不起作用。

final url = Uri.parse('http://192.168.***.*:***/');
final headers = {"Content-Type": "MobilSchnittstelle.html?cmd=XamServerDate"};
final json = '{"title": "Hello", "body": "body text", "userId": 1"}';
final response = await http.post(url, headers: headers);
print(url);
print('Body: ${response.body}');

并且将整个调用放在“Uri.parse”中也不起作用。我应该怎么办?

标签: flutterhttppostrequest

解决方案


推荐阅读