有谁知道我为什么一直收到错误400分析错误时,张贴到应用程序引擎?我的JSON很好。我有JSON.encoded。以前有人遇到过这些问题吗?
这是我的HTTPRequest代码。
sendData = JSON.encode(data);
_httpRequest = new HttpRequest()
..open(method, url)
..setRequestHeader("Authorization", "Bearer " + tokenKey)
..onLoadEnd.listen((e) => _loadEnd(_httpRequest))
..send(sendData);发布于 2013-12-05 20:27:46
不要忘记将标题指定为内容类型: application/json,因为没有它,数据就是text/html。愚蠢的错误。
更新后的帖子:
sendData = JSON.encode(data);
_httpRequest = new HttpRequest() ..open(method, url) ..setRequestHeader("Authorization", "Bearer " + tokenKey) ..setRequestHeader("Content-type", "application/json") ..onLoadEnd.listen((e) => _loadEnd(_httpRequest)) ..overrideMimeType("application/json") ..send(sendData);
https://stackoverflow.com/questions/20390850
复制相似问题