API Testing / Quiz

Content Negotiation: 406 vs 415

Accept, Content-Type, language, encoding, and the Vary header that keeps caches from serving the wrong representation.

Difficulty
Easy
Format
Quiz
Points
100
Estimate
8 min

// MISSION BRIEF

Your Mission

Content negotiation is the quiet handshake where client and server agree on format, language, and encoding. This quiz nails the two status codes testers confuse (406 vs 415) and the Vary header whose absence poisons caches.

// FIRST CONTACT

Battle teaser

A client sends Accept: application/xml to a JSON-only endpoint. The strictly-correct response when the server cannot produce XML:

  1. A415 Unsupported Media Type
  2. B406 Not Acceptable, it cannot produce the requested representation
  3. C500 Internal Server Error
  4. D400 Bad Request
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

apicontent-negotiationhttpcaching