Use case: Multiple formats and multilingual site

Description
A user Robert is looking for information about artwork resources in the server of a museum at the URI:
https://www.example.com/artwork/{{ "{id}" }}
Robert wants to see an image representation of the selected artwork and download it either with svg or png formats. Also because he is bilingual he prefers to have a textual representation ideally in English or French. Finally to reduce the size of the response he specify that he prefers the gzip encoding.

Requirements
  • Serve different file formats with the same URI.
  • Propose multiple representations of a resource in several languages.

Solutions
  • Use HTTP accept header to convey the preferred media types.
  • Use HTTP accept-language header to convey the preferred languages.
  • Use HTTP accept-encoding header to convey the preferred encodings.
  • Use HTTP q-value to express the preference of different representations of the same dimension.

Content negotiation dimensions

Links

References
[{{ reference.id }}] : {{ reference.title }}