【发布时间】:2019-06-15 07:14:47
【问题描述】:
我有这个来自 http 推送的响应正文
"{"标识符":"00000000-0000-0000-0000-00000000000"}"
我想将 000000... 部分作为字符串
这是我的代码的相关部分
.
.. async {
await http
.post(Uri.encodeFull(mainURL + registrEndPoint + _stuff))
.then((res) {
if (res.statusCode == 202) {
Map _body = jsonDecode(res.body);
// I checked debugging, the respons boy is ok
String _id =_body['identifier'];
return _id;
}...
我相信我在“映射”中遗漏了一些东西
我怀疑组合'quote-curlyBraces-quote'
打败我的 jsonDecode;
有什么建议吗?
提前致谢
【问题讨论】:
-
String _id =_body['identifier'];能得到什么? -
似乎为空,当我调试时它只是跳过断点
-
使用调试器应该不难调查
_body中的实际内容。 -
'悬停'鼠标在上面不显示任何内容,跳过下一步,返回为空
标签: json http dart flutter decode