I need to add a query string to some of my $http calls. Now $httpProvider.defaults.transformRequest seems to receive 2 objects: data and a headersGetter, neither allow me to directly change the url or add a get variable.
Any ideas?
You need an interceptor. From the angular docs on $http:
There are two kinds of interceptors (and two kinds of rejection interceptors):
request: interceptors get called with http config object. The function is free to modify the config or create a new one. The function needs to return the config directly or as a promise.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With