flutter - 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”中也不起作用。我应该怎么办?
解决方案
推荐阅读
- angular - 覆盖排序表的角度材料默认样式
- python - 如何修复“溢出错误:编码字符串时不支持的 UTF-8 序列长度”
- arrays - Spark - 从嵌套数组中的结构中选择列时出错
- powershell - 批量调用powershell时如何在一行中回显变量和字符串
- python - 如何指定与多个相似表的关系
- react-native - 通过异步 saveToStorage(userData) 获取不同页面中的保存数据
- python - 如何处理芹菜和弦中的错误?
- php - 如何修复:自定义类别导航显示重复项目
- swift - 如何使用 Swift 5 以编程方式在 iOS 12 中打开“定位服务”?
- javascript - 禁用 StackEdit 的全屏或模式