tags:

views:

55

answers:

2

I don't understand what the ID is for in JSON RPC. Also, how bad is it considered to not use JSON-RPC.org's standards when developing a toolkit? There seems to be some ambiguity in the JSON-RPC world.

P.S. The ID I'm referring to is the id in here:

{"params":["Hello","World"],"method":"hello_world","id":1}
+4  A: 

You're not guaranteed to get your answers back in the order you asked for them; the id is to help you sort that out.

Andrew McGregor
Oh, in the case of asynchronous calls. That makes sense.
orokusaki
A: 

The "id" is returned in the corresponding response object, so you can map one context to the other.

If you are making synchronous single calls, it might not make sense, but in an async multi-outstanding-call enviroment it is vital.

It should not be hard coded to 1, but set to a unique value for every request object you generate from the client.

MPCM