No changes required. It should accept any JSON resource.
Having said that, there's a much bigger improvement if you're progressively writing out the JSON rather than doing it in one big lump.
Having said that, there's a much bigger improvement if you're progressively writing out the JSON rather than doing it in one big lump.
On the server side, you may run into an error after you started writing out your reply. That may cause an incomplete reply. It may require more involved error handling between the server and client. 'Gather first write later' approach gives you a simpler error propagation between server and client.