firebase - 未处理的异常:FormatException:使用注册 Firebase 方法时出现意外字符(在字符 1 处)
问题描述
所以我正在尝试使用 firebase 实时数据库发布,我的注册功能如下所示:
Future<void> signup(String email, String password) async {
var url = Uri.https(
'identitytoolkit.googleapis.com',
'/v1/accounts:signUp?key=[API_KEY]',
);
final response = await http.post(
url,
body: json.encode(
{
'email': email,
'password': password,
'returnSecureToken': true,
},
),
);
print(json.decode(response.body));
}
我得到的完整错误是:
E/flutter(7313):[错误:flutter/lib/ui/ui_dart_state.cc(186)]未处理的异常:FormatException:意外字符(在字符1处)E/flutter(7313):E/flutter(7313):^ E/颤振(7313):
似乎我正在通过 html 但它需要 json ,但文档没有提到这一点,而且我正在遵循的课程使用它并且它工作正常,知道吗?
解决方案
推荐阅读
- javascript - 如何获取当前目录的文件句柄
- angular - 如何下标过滤后的 observable
- javascript - 无论如何,是否可以将存储添加到松弛的工作区?
- git - 克隆的 repo 不会与父 repo (root) 一起提交
- bootstrap-5 - 深度链接引导程序 5
- javascript - 具有多个来源的 HTMLAudioElement 对象
- reactjs - 找不到模块:无法解析“axios”
- c++ - 字符串连接时间复杂度 S+=X 和 S = S+X
- javascript - reactjs 如何删除表中的特定行?
- amazon-web-services - 跨区域使用 CloudWatch 事件调用 lambda