What is the difference between the two endpoints? Is there doco on when to use each and can both be used from the browser (i.e. is CORS an issue)?
REST vs JSON-RPC
Collapse
X
-
The difference is architectural / design based. Essentially they're both transporting JSON over HTTP.
A JSON-RPC API typically has one to a few endpoints, where you send methods you want to call on the API (RPC = Remote Procedure Call), while with a RESTful architecture, each resource tends to have its own endpoint.
Further, with a RESTful architecture typically you will use HTTP verbs appropriately, i.e., idempotent actions (things that don't have side-effects) should be made using GET and PUT, while other actions with side-effects should be made with POST, DELETE etc.
Personally I found it easier to deal with the JSON-RPC API rather than the RESTful one because in my opinion Betfair didn't do a great job with the design of the RESTful API, and it's a bit counter-intuitive in places.
-
Both are almost identical. The difference is really minor. Personally, I use JSON-RPC because of fewer endpoints. I can easily switch to RESTBetfair Bots Made Easy
Comment
-
Whilst RESTful endpoints thing is debated more than religion nowadays, I think JSON RPC interface is a little over the top as none of calls are async so I dont really see the benefit (by async mean in terms of picking up results to different messages on different calls). Kind of like their openssl cert things but you still post the username/password, because with just the latter two you can't really do anything on the web interface?
Comment


Comment