Sometimes we might be asked to fetch the x-csrf-token value before we make a POST request. This artical shows how to fetch the x-csrf-token value in header section.
Demo in POSTMAN
We add a pair of key-value to Headers in a GET request.
Key | Value |
---|---|
x-csrf-token | fetch |
Execute the request.
Then we retrieve the return Header.
Find the x-csrf-token → VALUE.
Finally, we can use this token to access other APIs.
留言