Send request data as JSON body

The current implementation sends request data as form parameters which doesn't work for endpoints that take array data (for example templates/render.