我目前有一个反应按钮,它应该通过 post 将数据从状态发送到 servlet。服务器正在从 fetch 方法中得到命中,但数据似乎为空。
fetch(
"http://localhost:8080/askQuestion",
{
method: "post",
body: {
question: this.state.value
},
headers: {
"Content-Type": "application/text"
}
}
).then(console.log(this.state.value));
我的请求对象中的正文和问题的值为空
request.getParameter("question");
request.getParameter("body");
萧十郎
慕哥9229398
相关分类