Auth Header Demo
Send Authorization: Bearer … as a request header (fake token; no real login).
Many APIs expect an Authorization header. This lab only
demonstrates attaching Bearer + a fake token — JSONPlaceholder
ignores it. Never put real secrets in front-end source for production.
Results appear here.
Important JavaScript
const response = await fetch(url, {
headers: {
Authorization: "Bearer " + token,
Accept: "application/json"
}
});