-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headers not send #40
Comments
Hey, What Angular version are you using? Headers support in $resource was added since version 1.1.4, so if you're using a version before that one, headers won't be sent as Restangular depends on $resource. Check angular/angular.js#965 Thanks! |
Otherwise, if all the headers are always the same, you can use |
I was using angular 1.0.6 and also tried the second option to mention. I now switched to 1.1.4 and it works smoothly. Thanks for pointing this out. |
No problem! Thanks for using the library :) |
I am using latest 1.1.4. Here is a stub of .config. Trying without success to send a custom header.
I look at fiddler to see what was sent and it added:
And it turned the method from GET to OPTION. |
That's actually Angular's code, not mine, so I don't know why it's not working for you in that case. You should open an Issue in Angular's GitHub. Otherwise, You can try sending the headers in every Restangular request: $scope.venue = Restangular.one("venues", $scope.venueId).get(params, {'x-gonto': 'hey'}); That will send the header x-gonto only for that particular request. Anyway, $httpProvider.defaults.headers.... should work as well. |
I think Angular implements this: |
Having following service:
If calling getTests or getTest I assume the header is set but it isn't. Am I doing something wrong?
The text was updated successfully, but these errors were encountered: