3 ms·
What is the usefulness of this feature? The only advantage I see is that your clients can choose the format they want to work with, but since the serialization
by Longwelwind 6y ago
What is the usefulness of this feature?
The only advantage I see is that your clients can choose the format they want to work with, but since the serialization format is just a message format that has no impact on the code, and that most of them have a bijective transformation between them, I don't see the point.
If it feels like a lot of work (Or the added complexity of a moving part, if using the tool you linked) for next to no impact.
- dec0dedab0de 6y agothings like this are useful if you have a user that is integrating your api into some kind of legacy application that does not support json. Then in the future when JSON goes out of style, you could easily add support whatever the new format is.
- pionar 6y agoIf you don't care about others using your API, then don't do it. If you do, follow the standard which says you SHOULD have a Content-Type if there is a body to your response.
- Longwelwind 6y agoMy comment was about whether it's worth supporting multiple values for the "Accept" header, not the "Content-Type" header.