Hi Matt,

I must have missed this. Thank you!

Johannes


On Tue, Feb 4, 2014 at 11:48 AM, Matt Goodall <[email protected]>wrote:

> On 4 February 2014 10:33, Johannes Zorn <[email protected]> wrote:
> > Hi,
> >
> > I implemented an httpInterceptor in the config block of an application
> that
> > requires access to the $httpProvider to set the default Authorization
> > header. Now I'd like to move this interceptor to a service. I assume it
> is
> > not possible to access the $httpProvider in a service. Is there another
> way
> > to set a header for all following HTTP requests? What's the best
> practise in
> > that case?
>
> You can set future request defaults via the standard $http service's
> $http.defaults. I'm adding an Authorization header using that and it
> seems to work well. See
> http://docs.angularjs.org/api/ng.$http#description_setting-http-headers
> for details.
>
> - Matt
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/Us6JbgP_cps/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to