Add `application/json` support for request bodies

I've tried to add JSON support for request bodies.
It's the first time I've changed something to the code, so I'd like to hear what you think.