Even on the wiki you can find examples .
If they are not enough, then you can see the specification , as comrade @kmv advised, or look at the Habr .
If simple, then traditionally (though not necessarily) JSON-RPC is used to provide web services, that is, via HTTP.
A web service is accessed by an HTTP request using the POST method; there are some limitations , which are mainly determined by the implementation environment (that is, the server part).
That is, JSON (string) is sent to the access point (usually it is one) according to the specification , and a response from the server is expected.
>> { "jsonrpc": "2.0", "method": "web_function", "params": { "var1": 4, "var2": 42 } } << { "jsonrpc": "2.0", "result": 46, "id": null } >> { "jsonrpc": "2.0", "method": "web_function", "params": [ 'a', 'b' ], "id": 1 } << { "jsonrpc": "2.0", "result": 'ba', "id": 1 } >> { "jsonrpc": "2.0", "method": "web_function_2", "params": [ 'c', 1 ], "id": 2 } << { "jsonrpc": "2.0", "error": { "code": -32601, "message": "Method not found." }, "id": "2" }
Nevertheless, no one prohibits the use of WS as a transport in their web applications.
For other applications, the choice of transport is even greater, and the restrictions are imposed only by the server and the specific implementation.