JSON-RPC is a JSON-encoded remote procedure call protocol similar to XML-RPC and SOAP. Unlike its XML predecessor, it requires little overhead. It is also very simple while maintaining the human-readability of XML-RPC.
This is how our previous example expressed in a SOAP call will look with JSON-RPC 2.0:
{
"jsonrpc": "2.0",
"method": "FindMerchants",
"params": {
"lat": "54.350989",
"long": "18.6548168",
"distance": 200
},
"id": 1
}
This JSON document still requires proper HTTP headers, but even with the headers, it is still considerably smaller than the XML counterpart. The only metadata present is the file with the JSON-RPC version and the request ID. The method and params fields are pretty much self-explanatory. The same can't always be said about SOAP.
Even though the protocol is lightweight, easy to implement, and easy to use, it hasn't seen...