search

Home  >  Q&A  >  body text

angular.js - How to modify the header value that already exists in $resource?

The requirement is that when the query needs to be called, the corresponding header value in the query should be changed
The code is as follows: Assume that the factory name is App

    $resource("v1/app/volume/:id",{},{
         query:{
             method:'GET',
             isArray:false,
             headers: {
                 'Filter': 0                  
             }
         },
         save:{
             method:'POST',
             isArray:false
         }
     });

When I call

App.query({},function(data){
},function(error){
});

 如何将header中的Filter值设置为1?
曾经蜡笔没有小新曾经蜡笔没有小新2828 days ago505

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-05-15 17:02:37

    I’d better use $http honestly, it can be realized

    reply
    0
  • Cancelreply