magic_dev
magic_dev

Reputation: 1439

Angularjs: adding user info to all request headers in

I have an angularjs web application and it has so many files. We use $http and $resource for get, post, put and delete. I want to add user info to all request headers from angularjs. In angularjs, is there configuration like this? Or any suggestion for aspect like solution?

Upvotes: 0

Views: 85

Answers (1)

philippd
philippd

Reputation: 606

Yes, you can use request interceptors for this.

See here for some examples: http://www.webdeveasy.com/interceptors-in-angularjs-and-useful-examples/

Upvotes: 2

Related Questions