我在角度js中使用delete
方法,
控制器:
$scope.delete = function(object) {
$scope.deleteobject = {"id":object.id}
authService.deletedetails($scope.deleteobject).success(function(data, status) {
console.log("succesfully deleted");
}).error(function(data, status) {
console.log("data:",data);
console.log("status",status);
});
}
服务是
service.deletedetails = function(user) {
return $http.delete('/api/delete', user);
}
一切正确,但仍然显示error
,delete
在rest api
应用中工作。
面临错误: -
DELETE localhost:8100/api/delete 422 (Unprocessable Entity) Entryview.js:44 data: Object {Message: "Not Deleted"} Entryview.js:45 status 422 Entryview.js:47 config Object {method: "DELETE", transformRequest: Array[1], transformResponse: Array[1], id: 23, url: "/api/delete"…} –