【发布时间】:2017-09-07 10:27:39
【问题描述】:
fetch() API 未发布此 JSON 正文。
var j = {
"addressee": "James"
};
return fetch('http://requestb.in/blahblahblah', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Cache-Control': 'no-cache'
},
body: JSON.stringify(j)
})
RequestBin 中绝对没有为此显示请求正文。身体会发生什么?调试JSON.stringify(j) 表明它确实在正确格式化正文。
【问题讨论】:
-
请求是否出现在浏览器开发者工具的网络窗格中?