freecoding.school100% FREE · NO SIGNUP
Endpoint BayISSUE #6 of 45

request headers · accept · auth · content-type

RestaVSThe 401 Bandit
Resta saysRequest headers carry metadata: what you accept, who you are, and what you’re sending.

Headers configure the request. Accept states the format you want; Content-Type describes the body you're sending; Authorization carries credentials (e.g. Bearer <token>); User-Agent identifies the client. They're key:value pairs the server reads to decide how to handle you.

Power-ups you unlock

The 401 Bandit attacks — common mistakes

Boss battleWrite the headers for a JSON POST with a bearer token.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJhbGc...</pre></body></html>
▶ Open the interactive comic issue
‹ Http Status Codes · 2xx · 3xx · 4xx · 5xxResponse Headers · Cors · Cache · Set-Cookie ›