Comment on page
NOTE: The content negotiation plays the key role in evolving an API, change management and versioning.
A client is programmed to understand the
application/vnd.example.resource+json; version=2message format semantics. The client requests a representation of the
/greetingresource in desired the media type (including its version) from the server:
GET /greeting HTTP/1.1
Accept: application/vnd.example.resource+json; version=2
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:
HTTP/1.1 200 OK
Content-Type: application/vnd.example.resource+json; version=2.1.3
NOTE: A server that doesn't have the requested representation media type available MUST respond with the HTTP Status Code 406 Not Acceptable.NOTE: A server MAY have multiple choices available and MAY respond with the 300 Multiple Choices response. In which case client SHOULD choose from the presented choices.