A JSON-RPC request

Class Methods

The following methods can be invoked on instances of this class.

__construct(mixed method, mixed params)

Constructs a new JSON-RPC request object

getRequest(int spec)

Get the raw, JSON-encoded request

sendTo(mixed target)

Send this request to a remote server directly

http_parse_headers(array headers)

Parses headers as returned by magic variable $http_response_header

setResponse(string response)

Interprets the response

setHeaders(array raw_headers)

Save and parse the HTTP headers

interpretResponse(array json_struct)

Interprets the parsed response

isError()

Determines whether an error occured

interpretResult(mixed spec, mixed assoc, mixed id)

Checks whether the given response is a valid result

interpretError(mixed spec, mixed assoc, mixed id)

Checks whether the given response is valid and an error

prepareRequest(mixed spec, mixed id, mixed method, array params)

Encodes the request properties

uuid()