2 ms·
Random question, which isn't clear from the spec: can arguments be arbitrarily "deep" JSON objects (i.e. arrays and objects) or are they limited to primitives (
by tlrobinson 17y ago
Random question, which isn't clear from the spec: can arguments be arbitrarily "deep" JSON objects (i.e. arrays and objects) or are they limited to primitives (strings, numbers, booleans, null)?
(obviously you could just pass a JSON serialized string, but that's not what I'm asking)
- benatkin 17y agoThey can be arbitrarily deep. Otherwise they couldn't claim to be supporting JSON objects as parameters. Of course, anyone could just do a REST request using a wrapper object with the name of the procedure and an id. Then you'd have implemented a JSON-based RPC mechanism yourself! So it's pretty trivial. This mainly exists to get the idea out and implementations in various scripting languages, methinks. One thing that might be cool: Perhaps an URL could map to an object, and making an rpc call on that URL could call a function on that object.
- tlrobinson 17y ago"Perhaps an URL could map to an object, and making an rpc call on that URL could call a function on that object." That seems to be what this article is advocating: http://www.sitepen.com/blog/2009/01/29/some-rpc-with-your-jsonreststore/ http://www.sitepen.com/blog/2009/01/29/some-rpc-with-your-js...