What are media types in REST, and how can custom media types support hypermedia and versioning?
Last updated
A media type identifies a representation's format (e.g.
application/json) inContent-TypeandAccept, driving content negotiation.Hypermedia types like
application/hal+jsondefine how links are expressed, and vendor types likeapplication/vnd.myapp.v2+jsonembed a version while keeping the URI stable.Media-type versioning is more RESTful than URI versioning but harder to test in a browser and less obvious to clients.