I'm designing the architecture for a new web application. I think that communications between the backend (server) and the frontend should be JSON only. Here are my arguments:
- Its the client responsibility to manipulate and present data in its own way. The server should just send to the client the raw information needed.
- JSON is lightweight and my application might be used by remote clients over poor mobile connections
- It allows multiple front-end developments (Desktop devices, mobile devices) and has the potential to create an API for other developers
I can't see any counter-argument to this approach, considering that we have internally the frontend skills to do almost everything we need from raw JSON information.
Could you provide counter-arguments to this JSON-only choice so that I can make a more informed choice? There must be some as a lot of backend frameworks (think about the php ones) still advertise HTML templating to send HTML formatted responses to the clients. Thanks
UPDATE: Even though I researched the topic before, I found a similar and very interesting post: Separate REST JSON API server and client?