How can the browser see the token value with each ajax request sent?

Open a page in vue and then the console will see two requests

(the backend said no token was received)

clipboard.png

clipboard.png

clipboard.png

clipboard.png


your backend is not lying, he may not get "token" indeed.
because some web frameworks "rename" the parameters in the request header when they receive the request.
for example: django, will capitalize all parameter names with the prefix "HTTP_" in front of them.
then when the backend acquires header, the parameter name becomes: HTTP_TOKEN
you can have your backend print the header to have a look.


clipboard.png


Last screenshot Request Headers isn't there a line token in the last screenshot, and that's where to check it.

Menu