However, ajax requests are perfectly capable of sending JSON-encoded
payloads within the body of a POST request, which is much cleaner. Here
is an example of how to send a JSON-encoded POST body with the jQuery
library:

Note that you have to send the JSON object as a string, since otherwise
jQuery will invoke the object’s toString() method, and you’ll end up
sending “[object Object]”, which is not particularly helpful!

Just about every server-side language has a JSON library, so decoding
the incoming request payload on the server side is trivial. Here are
some resources for common server-side languages:

C#

Java

PHP

Python

Ruby

Don’t forget to have the remote service send back its response in JSON,
too!