Skip to content

Content Negotiation

Medium — good to knowBackend

ELI5 — The Vibe Check

Content negotiation is when the client and server agree on what format to use for the response. The client says 'I prefer JSON but I'll take XML' and the server picks the best option it supports. It's like ordering at a restaurant — 'I want the steak medium-rare, but medium works too.'

Real Talk

Content negotiation is an HTTP mechanism where the client specifies preferred response formats via Accept headers, and the server selects the best representation. It covers media type (JSON vs XML), language (en vs fr), encoding (gzip vs br), and character set. Server-driven negotiation uses request headers; agent-driven uses links.

When You'll Hear This

"Our API supports content negotiation — send Accept: application/xml to get XML." / "Content negotiation lets the same endpoint serve JSON to APIs and HTML to browsers."

Made with passive-aggressive love by manoga.digital. Powered by Claude.