🎁 New User? Get 20% off your first purchase with code NEWUSER20 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

Progressive Enhancement
A web design strategy that starts with basic functionality for all browsers and progressively adds advanced features for capable ones.
Responsive Design
A web design approach that makes web pages render well on all screen sizes using flexible layouts and media queries.
Server-Sent Events (SSE)
A web technology enabling servers to push real-time updates to browsers over a single HTTP connection, simpler than WebSockets.
Webhook
A mechanism where a server sends real-time HTTP POST notifications to a specified URL when specific events occur.
Progressive Web App (PWA)
A web application that uses modern web capabilities to deliver app-like experiences with offline support and push notifications.
Web Components
A set of browser-native APIs for creating reusable, encapsulated custom HTML elements with their own styling and behavior.
View All Web Development Terms →