我用的是矩形,像这样:
stuffResource = parentResource
.one(resources.category, $scope.stuff.category)
.one(resources.stuff, $scope.stuff.id)
.put($scope.stuff);
现在,当请求被发送时,我的"stuff"对象是在查询字符串中发送的,而不是在正文中!
我做错了什么?
这里要做的是使用customPUT()而不是普通的put()。
stuffResource = parentResource
.one(resources.category, $scope.stuff.category)
.one(resources.stuff, $scope.stuff.id)
.customPUT($scope.stuff);
从docs
put([queryParams, headers]):对当前元素执行put操作
customPUT([elem, path, params, headers]):对特定路径执行PUT操作。你可以选择设置参数、头和元素。Elem是要发布的元素。