All pastes #932409 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-03-07 18:45 UTC
rendered paste body
Messages are valid JSON, see http://json.org/.

Both the request and the response are JSON objects.

The request must include a pair with the name 'version'. If the value associated 
with the name 'version' is not '1.0', this response must be sent back:

{"version": "1.0", "error": "wrong-version", "result": "1.0"}

A pair with the name 'name' must also be included. The value must only contain
the characters a-z, A-Z, 0-9, _, and '.'. It must start with a-z or A-Z, and
cannot end with '.'.

A pair with the name 'params' must also be included. It is an array of JSON
values.

A response must include 'version', which must be '1.0'.

It must also contain 'error', which should be null or a string (null if the
request succeeded, an error description otherwise). Some strings are given
special interpretation, see below.

It must also include 'result', which is a JSON value.

The 'special' errors:

wrong-version -- the version of SRPC supplied was not 1.0.

Example cycles:

--> {"version": "1.0", "name": "post.view", "params": [1]}
<-- {"version": "1.0", "error": null, "result": {"author": "foo", "title":
    "bar", "content": "baz"}

--> {"version": "3.0", "name": "post.view", "params": [1]}
<-- {"version": "1.0", "error": "wrong-version", "result": "1.0"}