Content Negotiation

Noun · Development

Definitions

  1. An HTTP mechanism where the client and server agree on the best representation of a resource. The client sends Accept headers (Accept: application/json, text/html) and the server selects the best match. Also applies to language (Accept-Language), encoding (Accept-Encoding), and character set. Enables a single URL to serve JSON to APIs and HTML to browsers.

    In plain English: The HTTP mechanism where client and server agree on the format (JSON, HTML, XML) for the response.

    Example: "The /users endpoint returns JSON for Accept: application/json and HTML for Accept: text/html — content negotiation handles both from one route."

Related Terms