如何正确编写

时间:2020-09-16 08:37:38

标签: javascript node.js reactjs

requestoptions = {method:“ POST”, 凭据:“相同来源”, 标头:{“ Content-Type”:“ application / json”}, 正文:JSON.stringify(Cookies.get(“ refreshtok”)}

}

正文:JSON.stringify(Cookies.get(“ refreshtok”)}在此行中表示预期的“,”

1 个答案:

答案 0 :(得分:1)

您忘记了JSON.stringify中的右括号:

    requestoptions = {
        method : "POST", 
        credentials: 'same-origin', 
        header: {
            "Content-Type":"application/json"
        }, 
        body: JSON.stringify(Cookies.get("refreshtok"))
     }