What is content negotiation?

Definition

Content negotiation lets one URL represent the same underlying resource in formats suited to different clients. A browser may receive HTML, while a compatible tool may request compact Markdown or structured data by sending an accepted media type or another supported preference.

Servers should make negotiated behavior deterministic and cache-safe. Responses need the correct content type and variation headers, and every representation should preserve the same authoritative meaning. A client that does not request a special format should continue to receive the normal human-facing page.

Acronyms and aliases

HTTP content negotiation variant

Frequently asked questions

How can content negotiation help an artificial intelligence agent?

It can let the agent request a compact text representation instead of downloading and parsing the complete visual HTML interface.

Does content negotiation require a different URL?

Not necessarily. The server can select a representation for the same URL from request headers, although explicit format URLs are also possible.

Videos explaining content negotiation