4 ms·
If the server generates custom mimetypes, clients have to ensure they "Accept:" the correct mimetype for every request. No, he doesn't. First, the server can s
by icebraining 15y ago
If the server generates custom mimetypes, clients have to ensure they "Accept:" the correct mimetype for every request.
No, he doesn't. First, the server can send whatever it wants - nothing breaks if you reply with your custom media type to a generic "application/json" request.
Second, even if you want to be correct, that's what wildcards are for: the client can simply send always the same header:
Accept: application/*+json
If the server generates custom mimetypes, and you update your API to v2 which produces an article listing in an incompatible format, you either have to introduce a version number into your mimetype (which seems messy and pointless busywork),
I still don't get what's the problem with changing a string. I think you're using a bad framework.
- waitwhat 15y agoI doubt that sending a mimetype which the client has said it can't accept would be on anyone's list of best practices. This is a good point, though, not sure why it escaped me: Accept: application/*+json I think you're using a bad framework. Probably. This isn't why, though.