/ 开发笔记

Bearer Token怎么用?

Bearer Token拿到以后,需要在http请求中,添加header:

Authorization: Bearer <token>

例如:

curl -X 'GET' \
  'http://localhost:1337/games/count' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiaWF0IjoxNjIyNjg2MjUzLCJleHAiOjE2MjUyNzgyNTN9.Fs9AhAgpBvSBy'