Changeset 29373 in project


Ignore:
Timestamp:
07/15/13 20:33:46 (7 years ago)
Author:
Timusan
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/json-rpc

    r29367 r29373  
    2323=== Repository
    2424
    25 The code is hosted on an external repository and can be found [[https://bitbucket.org/Timusan/json-rpc/|here]]:
    26 
     25The code is hosted on an external repository and can be found [[https://bitbucket.org/Timusan/json-rpc/|here]].
    2726
    2827=== Documentation and examples
     
    4443
    4544When defining your connection, you have to give an OUTPUT PORT and INPUT PORT as well as a STRING containing the JSON-RPC version.
    46 This implementation is made for version 2.0, so this version string will always be "2.0" (until a new version of JSON-RPC is released).
     45This implementation is made for version 2.0, so the version string will always be "2.0" (until a new version of JSON-RPC is released).
    4746
    4847For demonstration purposes: Let's define a connection to a XBMC media center, which uses JSON-RPC for its remote calls:
     
    5554Once setup, this will return a procedure that accepts a method and optional params.
    5655You can then call this procedure to actually send a valid JSON-RPC formatted string to the server.
    57 Lets ask the server for a listing of the current active players:
     56Let's ask the server for a listing of the current active players:
    5857
    5958<enscript highlight="scheme">
     
    7170Then it will get formatted to valid JSON and send to the server.
    7271
    73 The transformation from CHICKEN to JSON (and back) is done trough the wonderful Medea.
     72The transformation from CHICKEN data objects to JSON (and back) is done trough the wonderful Medea.
    7473
    7574You can optionally include params to be send with your method.
    7675The JSON-RPC spec defines two types of params:
    7776
    78 * Positional, which will be represented as symbols
     77* Positional, which will be represented as literal symbols
    7978* Named, which will be represented as keyword arguments
    8079
     
    8382Take, for instance, sending a command to play or pause your XBMC box.
    8483Here you not only need to send the method, but also send which player you wish to pause or play.
    85 This would look something like this:
     84This would look something like the following:
    8685
    8786<enscript highlight="scheme">
     
    9998
    10099And finally, you can nest your params.
     100
    101101We now want to know the title, album and artist of a certain playlist.
    102102For this we can use a vector inside a listing of keyword arguments:
Note: See TracChangeset for help on using the changeset viewer.