這是我的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,但它給了我錯誤的請求錯誤。 –