5 ms·
Seems to me he is abusing the Accept-header. In his example, the application provides a JSON-response, but with a vendor-specific media type. Once the API versi
by iSnow 14y ago
Seems to me he is abusing the Accept-header. In his example, the application provides a JSON-response, but with a vendor-specific media type. Once the API version changes, he changes the media type again.
This is both impractical because if the client application consuming the content happens to be a web browser, it will not see JSON and at least to me seems like a major flaw: if it is JSON, use the appropriate media type.
If you need to fiddle with HTTP headers, probably a X-API-VERSION header would be more logical instead of clobbering the media type.
- urbanautomaton 14y agoI don't think "media type" is synonymous with "data format". For example, IANA considers atomcat+xml and atomsvc+xml to be distinct media types [1], despite them both being XML, and there are 406 other XML-based media types in that list. [1] http://www.iana.org/assignments/media-types/application/index.html http://www.iana.org/assignments/media-types/application/inde...