这是我的API'/ api/comments/{id}'在Restangular调用PUT API
上面的API需要id以及json数据。
我试过下面的代码,但它似乎并没有工作。
Restangular.one('api/comments/'+commentUID).put($scope.updateCommentData).then(function (responseData){
});
我需要发送请求有效载荷与认沽呼叫
$scope.updateCommentData = {
"CommentUID": commentUID,
"AssetUID": $scope.currentAsset.AssetUID,
"Note":note,
"VisibilityEnum": 2,
"Ver": version
};
任何一个可以帮助我...
您可以请检查控制台/网络中调用的网址 –
这可能有助于http://jsfiddle.net/merlinran/8fvGh/ –
在控制台中调用正确的URL,但它给了我错误的请求错误。 –