質問

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