Bearer Token Authentication
Send a JWT or API key as Bearer token
cURL Command
curl -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." https://api.example.com/me
Flag-by-flag explanation
- -H
- Adds the Authorization header with Bearer scheme
Python equivalent
import requests
headers = {"Authorization": "Bearer <token>"}
r = requests.get("https://api.example.com/me", headers=headers)JavaScript fetch equivalent
await fetch("https://api.example.com/me", {
headers: { Authorization: "Bearer <token>" }
});