AngularJS (500 Internal Server Error) for http put

AngularJS (500 Internal Server Error) for http put

本文关键字:for http put Error Server Internal AngularJS      更新时间:2023-09-26

我想将记录更新到 api。

在我的萤火虫中,它显示:

500内部服务器错误,

XML 分析错误:未找到元素 位置:moz-nullprincipal:{f514f16e-f3d3-49f1-99e6-105b2b80f26c}第 1 行第 1 列:

并且还显示:

没有子对象

这是我的代码

$scope.EditUser = function(){
    $scope.ApplicationId = '7bg67898ewnbqjq65e';
$http.put("mydomain.com/api/Users/UpdateUser", {}, {
   params: { _id: $scope.selectedItem._id, ApplicationId: $scope.ApplicationId, User_Name : $scope.selectedItem.UserName, IsActive: $scope.selectedItem.IsActive }
});

这是用这个解决

$scope.EditUser = function(){
    $scope.ApplicationId = '7bg67898ewnbqjq65e';
$http.put("mydomain.com/api/Users/UpdateUser", {
    _id: $scope.selectedItem._id, ApplicationId: $scope.ApplicationId, User_Name : $scope.selectedItem.UserName, IsActive: $scope.selectedItem.IsActive 
});

执行 PUT 请求的快捷方法是:$http.put(url, data, [config]);@user3055606您的答案是否正确。