I've tried many different ways to set header with $http.defaults.headers.common.Authorization = 'Bearer ' + token; in the config and in the $http get parameters.
No matter what, it does not get included into the headers. Here is the AngularJS request headers printout from the server. INFO: access-control-request-headers/authorization INFO: connection/keep-alive INFO: accept-language/en-US,en;q=0.8 INFO: host/tc:8080 INFO: accept/*/* INFO: access-control-request-method/GET INFO: origin/http://localhost:8100 INFO: user-agent/Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) INFO: accept-encoding/gzip, deflate INFO: referer/http://localhost:8100/ And here is the printout from Postman client INFO: cache-control/no-cache INFO: connection/keep-alive INFO: accept-language/en-US,en;q=0.8,th;q=0.6 INFO: host/tc:8080 INFO: accept/*/* INFO: postman-token/7dbcb478-a02b-a4de-e87d- INFO: authorization/Bearer jK572w/FKLAPFU5OkZBLHanWuf3kmHy456SM6UZnRSjmyM+4Job1Zw63i61ebowO INFO: user-agent/Mozilla/5.0 (Windows NT 6.1) INFO: accept-encoding/gzip, deflate On the postman the token key is received by the server with key 'authorization'. But there's no authorization key from AngularJS only as value of access-control-request-headers Please see if I'm missing something. Do I need a library? I searched many topics on stackoverflow but no answers. Thank you. -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" 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 https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
