Learn Quiz

HTTP Quiz

Test your HTTP headers and methods knowledge. — 7 questions

Question 1 of 7 Score: 0

About the HTTP Quiz

Test your HTTP headers and methods knowledge. This quiz has 7 multiple-choice questions. Each question has one correct answer, and you see an explanation straight after you answer, so you learn from every question — including the ones you get wrong. There is no time limit and nothing to sign up for; your answers are not stored.

The questions follow the material in the HTTP Headers Explained guide and the HTTP Status Codes cheatsheet. Read them first if you want to prepare, or take the quiz cold to find the gaps in what you know.

Questions in this quiz

Preview the questions below. Each answer and its explanation are hidden until you choose to reveal them, so you can still take the quiz above without spoilers.

1. Which header carries the authentication token in most API requests?

  1. Content-Type
  2. Accept
  3. Authorization
  4. X-Auth-Token
Show answer

Answer: C. Authorization
Authorization: Bearer <token> is the standard header for JWT and OAuth tokens.

2. What does the Content-Type header specify?

  1. The size of the body
  2. The character encoding of the URL
  3. The MIME type of the request or response body
  4. The server software version
Show answer

Answer: C. The MIME type of the request or response body
Content-Type tells the receiver how to parse the body. Common values: application/json, text/html, multipart/form-data.

3. Which header prevents a page from being embedded in an iframe on other domains?

  1. Strict-Transport-Security
  2. X-Frame-Options
  3. Referrer-Policy
  4. X-Content-Type-Options
Show answer

Answer: B. X-Frame-Options
X-Frame-Options: DENY or SAMEORIGIN prevents clickjacking by blocking the page from loading inside an iframe on external sites.

4. What is the difference between Cache-Control: no-cache and no-store?

  1. They are identical
  2. no-cache means do not cache at all; no-store means revalidate before use
  3. no-store means do not cache at all; no-cache means store but revalidate before use
  4. no-cache disables the browser cache; no-store disables CDN caches only
Show answer

Answer: C. no-store means do not cache at all; no-cache means store but revalidate before use
no-store prevents any caching. no-cache allows storing the response but requires the client to revalidate with the server before using it.

5. Which response header enables CORS for a specific origin?

  1. Referer
  2. Origin
  3. Access-Control-Allow-Origin
  4. X-Permitted-Cross-Domain-Policies
Show answer

Answer: C. Access-Control-Allow-Origin
Access-Control-Allow-Origin is the CORS response header. A value of * allows all origins; a specific origin like https://example.com restricts access.

6. What does the ETag response header enable?

  1. Gzip compression
  2. Conditional requests — the client can ask if the resource changed since last fetch
  3. Cookie-based authentication
  4. Redirect chaining
Show answer

Answer: B. Conditional requests — the client can ask if the resource changed since last fetch
The server sends ETag: "abc". The client then sends If-None-Match: "abc" on the next request. If unchanged, the server returns 304 Not Modified, saving bandwidth.

7. Which header tells the server what media types the client can handle?

  1. Content-Type
  2. Accept
  3. Transfer-Encoding
  4. Vary
Show answer

Answer: B. Accept
Accept: application/json tells the server the client wants JSON. The server responds with Content-Type to confirm what it actually sent.

How to use this quiz

  • Answer every question before reading the explanations below — retrieving an answer from memory is what makes it stick.
  • Note the questions you missed and revisit the matching section of the guide or cheatsheet.
  • Retake the quiz a day or two later. Spaced repetition is one of the most reliable ways to remember technical details.

Related