预先飞行选项请求成功后,AngularJs $ http删除方法返回401

时间:2018-11-15 05:12:58

标签: javascript angularjs ajax

这是我用来执行删除REST调用的示例代码。 当我调用$ scope.chekFunc(a,b,c,d);客户端发送OPTION请求并收到200个响应,但在实际的DELETE调用中却失败,并显示401。

$scope.chekFunc= function(a,b,c,d){
var chkUrl= page.getUrlvalue(a,b,c,d); //returns Url with a,b,c,d params
 $http.delete(chkUrl, null, {withCredentials: true,})       
    .success(function(response) {
       console.log(response);
     // Other Stuff
    })
    .error(function(response) {
        console.log(response);
    });}

0 个答案:

没有答案