๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

Web Development Intermediate

What is Content Negotiation?

An HTTP mechanism where client and server agree on the best representation of a resource based on format, language, or encoding preferences.

Content negotiation allows serving different representations of the same resource based on client capabilities and preferences. The Accept header specifies preferred media types (application/json, text/html). Accept-Language indicates language preference (en, de, fr). Accept-Encoding specifies compression support (gzip, br). The server examines these headers and responds with the best match, indicating the choice via Content-Type, Content-Language, and Content-Encoding response headers. This enables APIs to return JSON or XML from the same endpoint, serve WebP images to supporting browsers with JPEG fallback, and deliver localized content โ€” all at the same URL.

Related Terms

Web Vitals
Google's metrics for measuring user experience quality, including loading speed, interactivity, and visual stability of web pages.
Brotli Compression
A modern compression algorithm developed by Google that achieves better compression ratios than Gzip for web content delivery.
JSON
JavaScript Object Notation โ€” a lightweight data interchange format that is easy for humans to read and machines to parse.
HTTP/3
The latest HTTP version that uses QUIC instead of TCP, providing faster connections and better performance on unreliable networks.
DOM (Document Object Model)
A programming interface for HTML documents that represents the page structure as a tree of objects that can be manipulated with JavaScript.
API (Application Programming Interface)
A set of rules and protocols that allows different software applications to communicate and exchange data.
View All Web Development Terms โ†’