I am writing an angular app and have been asked to store a Json Web Token in a cooke and supply it in the HTTP headers with every request.

Does anybody know how to attach HTTP headers and what the header should be called?

I'm using Restangular if that changes anything?

有帮助吗?

解决方案

The restangular readme has a FAQ called I need to send one header in EVERY Restangular request, how do I do this, which seems to match your question, pretty much.

If it's a cookie, then the header is called "Cookie". The value would be <cookie-name>=<jwt-value> where <cookie-name> is whatever the server wants the JWT cookie to be called.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top