我正在使用flutter应用程序与azure cosmos db对话。cosmos db有一个基于sql查询的rest api。其中内容类型应该是application/query+json。我尝试使用postman连接到cosmos db,它工作正常,但是在flutter中我得到了一个异常,因为 Bad state: Cannot set the body fields of a Requestwith content-type "
当我单击submit按钮时,我会得到一个404错误--没有找到(通过铬控制台/网络选项卡)。但是,当我通过postman测试API时(在正文中输入用户名和密码(json),将返回一个令牌)。登录页从另一个文件中调用一个函数,该文件用于验证用户并获取令牌。想知道我的fetch语句是否正确设置,这就是我拥有的:login(username, password) {
// Get a token from api server usin