I want to remove several header fields of the $http request from one specific request (this means that it is not at the level of $httpProvider ). These fields are:
- Cache control
- If-Modified-Since
- Referer
- X-Requested-With
How to do it in one request? I tried using the transformRequest parameter but did not find enough information to make it work. Such code [CoffeeScript]:
$scope.logout = -> $http({ method: 'GET' url: '/api/logout' headers: { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' } transformRequest: (data, headersGetter) -> console.log data console.log headersGetter data }).success -> $location.path('editor')
shows that data is undefined , headersGetter is function (c){a||(a=Nb(b));return c?a[y(c)]||null:a} (which tells me absolutely nothing) , and I did not understand what to return from the transformRequest function.
Paul
source share