Convert a JavaScript object into a JSON string, and send it to the server.