I am consuming a REST api using Angular JS, using $resource module. I have to encode the URL using a private key and send the results of the encoding process on a header. I am trying to intercept the request and getting the requested URL, but I could not do that.
return $resource(url, {}, {
get: { method: 'GET', headers: headers, transformRequest: function(data, headersGetter) {
// Here "data" is undefined. headersGetter() returns the headers.
// I need the URL here
}
});
Any help?