mgonto / restangular

AngularJS service to handle Rest API Restful Resources properly and easily
MIT License
7.88k stars 843 forks source link

Full response only for getList() request #1139

Open ajfranzoia opened 9 years ago

ajfranzoia commented 9 years ago

Hello. I'm trying to migrate from Angular $resource to Restangular. I'm facing some difficulties trying to reproduce this behavior:

MyResource.query({}, function(data, headers) {
  vm.items = data;
  vm.customStatus = headers('My-Custom-Header');
});

I want only for some certain requests to be able to inspect the full response data (and read its headers). I've found that setFullResponse() with addResponseInterceptor() is the way to go, but I can't get it working for a single request. I'm using Decoupled Services, is this possible to make? Or I must use the main Restangular service? Thanks for your help.

stevermeister commented 8 years ago

@augusto-cdxs you should put this header filed here https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Access-Control-Expose-Headers