【问题标题】:how to write this properly如何正确地写这个
【发布时间】:2020-09-16 16:41:46
【问题描述】:

requestoptions ={方法:“POST”, 凭据:'同源', 标头:{“Content-Type”:“应用程序/json”}, 正文: JSON.stringify(Cookies.get("refreshtok")}

}

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

【问题讨论】:

  • 你的问题是什么?描述一下。

标签: javascript node.js reactjs


【解决方案1】:

你忘记了JSON.stringify的右括号:

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

【讨论】:

  • 谢谢 maaaaaan。我以为我很愚蠢,但现在我也有同样的感觉,只是出于另一个原因-_-。
猜你喜欢
  • 1970-01-01
  • 2014-03-21
  • 2021-01-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-09-04
  • 1970-01-01
  • 2018-07-01
相关资源
最近更新 更多