Authorization Header Explained
What the HTTP Authorization header does and when it's used.
Published October 14, 2026
Authorization carries credentials to authenticate the client with the server, using a scheme such as Bearer or Basic.
How it works
Never send it over plain HTTP. Servers reply 401 if it is missing or invalid.
The Authorization header is part of the HTTP message and is case-insensitive in name.
In a real exchange
curl -i https://example.com/
Authorization: Bearer eyJhbGciOi...
Practical examples
The header
Authorization: Bearer eyJhbGciOi...Set or use it in code
fetch('/api/me', { headers: { Authorization: `Bearer ${token}` } })Inspect it
curl -sI https://example.com | grep -i 'authorization'Common mistakes
- Logging the header and leaking tokens
- Sending credentials over HTTP
- Using Basic auth without HTTPS
Key takeaways
- Authorization: Authorization carries credentials to authenticate the client with the server, using a scheme such as Bearer or Basic.
- Check it in browser DevTools → Network.
- Test with curl -I before deploying.
FAQ
Bearer vs Basic?
Bearer sends a token; Basic sends base64 of user:password.
Is Authorization case sensitive?
Header names are case-insensitive; values may not be.