0
点赞
收藏
分享

微信扫一扫

Node.js_fs模块

E_topia 2024-07-24 阅读 10

环境复现

        前台:

wx.request({
url: 'xxxxxx',
method: 'POST',
header: {
"content-type": "application/json"
},
success(res) {
console.log(res);

},
fail(err) {

console.error('网络请求失败', err);
}
});

        后端使用springboot:

@RequestMapping(value = "/errApiList")
public String getProductionPlanList(HttpServletRequest req, HttpServletResponse res) {
String materialCode = req.getParameter("MaterialCode");
}

将请求方式换成GET,后端可以正常拿到数据,但是换成POST就拿不到。

解决方式:

更改请求头:"content-type": "application/x-www-form-urlencoded"

举报

相关推荐

0 条评论