by ars · 11y ago · 0 comments
I have no doubt you CAN do it, but most of the time you don't.
And since most of the time you are dealing with strings my question stands: Why do the conversion manually instead of letting the nice new feature do it for you.
If you did send everything as JSON you would be bypassing everything PHP does with form/url data to make things easier for you (for example arrays). That doesn't seem like a good engineering tradeoff.
And then you can't make a request to the server directly unless you format your data as JSON, which is a bit inconvenient, especially if you're debugging a problem.
So if using JSON as a container isn't gaining you some other benefit then it's probably best avoided.