curl -H 'Authorization: Bearer TOKEN' https://api.example.com/me

Category: Web App Development

curl -H 'Authorization: Bearer TOKEN' https://api.example.com/me

Call an API with a bearer token header

Sends a raw Authorization header carrying a bearer token, the standard way to authenticate against modern APIs. Replace TOKEN with the value from your login response. Store it in a shell variable to avoid pasting secrets into history.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.