Вопрос

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