Content Negotiation

Every API MUST implement and every API Consumer MUST use the HTTP content negotiation where a representation of a resource is requested.

NOTE: The content negotiation plays the key role in evolving an API, change management and versioning.

Example

A client is programmed to understand the application/vnd.example.resource+json; version=2 message format semantics. The client requests a representation of the /greeting resource in desired the media type (including its version) from the server:

The server can provide only a newer version of the requested media type version=2.1.3. But since the newer version is backward compatible with the requested version=2 (related: Changes & Versioning) it can satisfy the request and responds: