HTML first gives you automatic JSON
You should always support a human readable HTML page of any data you publish, and mark it up with microformats2. At that point you don't need a separate JSON representation, because microformats2 parsers give you back canonical JSON which you can then serve if you wish, e.g. see Aaron Parecki's example below.
Accepting JSON POST requests
JSON does not have as wide support for POST requests compared to form-encoded requests.
In most web frameworks you have to jump through hoops to read the raw POST data if it's JSON format.
A Google search can confirm that lots of people are confused about how to handle JSON POST requests: how to receive JSON post in php, ruby, python, node
"I ditched content negotiation because it turned out to be a huge maintentance chore of very little actual value. ...the .json view was essentially the same as the parsed microformat view, and I never used it so it kept breaking"
"My .json view is *literally* the parsed microformat view. As in, I render the HTML as normal, then pass it through mf2-php before responding. It's like getting content negotiation for free."
Also see: p3k
- JSON Formatter
- JSONView - Chrome plugin which pretty-prints JSON
- JSON Formatter - A Safari extension which makes valid JSON documents human-readable.