我想发送一个JSON对象到我的web服务,它在请求数据中期待JSON。 这是我POST
呼叫从angularJSAngular JS POST请求不发送数据
$http({method: 'POST',
url: 'update.htm',
data: $.param($scope.cover),
headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}
}).success(function (data) {
// handle
});
价值覆盖对象
$scope.cover = {id:1, bean:{id:2}}
荫越来越500 (InvalidPropertyException: Invalid property 'bean[id]' of bean class [BookBean]: Property referenced in indexed property path 'bean[id]' is neither an array nor a List nor a Map;)
在网络上,我们以这种方式发送
bean[id]:1
我认为它应该像
发送bean.id:1
如何解决此问题。在此先感谢
为什么要使用$ .PARAM如果你要发送的JSON数据? – BKM