The server refused this request because the request entity is in a format not supported by the request
原因是在前台JS中传值写错了,将要传的值全部写在大括号内
$http.post("../loginActionToJson.action",
{"loginId" : userDetails.loginId,
"password" : userDetails.password, "code" : userDetails.code})
.success(function(data, status,headers, config){
$scope.products = data;
console.log(data);
})
本文介绍了一种常见的HTTP Post请求失败的问题,即由于请求实体格式不正确导致服务器拒绝请求的情况。具体表现为前端JS代码中POST参数书写不当,所有参数被错误地放置在一个大括号内。文章提供了错误示例代码并指出正确的做法。
1572

被折叠的 条评论
为什么被折叠?



