I have a website which uses Token-based authentication. At first, username and password are sent to log the user in and receive the token. For subsequent calls, I need to include the token as X-Auth-Token
in HTTP header.
I would like to know how to do that, in vanilla JavaScript or using jQuery. Could you please provide me a sample of code?