use fetch post send json can not

2017-09-01  本文已影响83人  张培_

情景描述

fetch('/todos',{
            method: 'POST',
            headers: new Headers({
                'Content-Type': 'application/json'
            })
            body:{text,user_id:1}
        }).then(.....)
"proxy": "http://localhost:8080"
{
    "text":"1111",
    "user_id":1
}  //成功返回状态码201

矛盾

解决





我的错误点

反思

action

上一篇 下一篇

猜你喜欢

热点阅读