Jelix 1.7.18

jJsonRpc
in package

object which encode and decode a jsonrpc request and response.

Tags
subpackage

utils

see
http://json-rpc.org/index.xhtml

Table of Contents

decodeRequest()  : mixed
decode a request of json xmlrpc.
decodeResponse()  : mixed
decode a jsonrpc response.
encodeFaultResponse()  : string
encode a jsonrpc error response.
encodeRequest()  : string
create a request content for a jsonrpc call.
encodeResponse()  : string
encode a jsonrpc response.
__construct()  : mixed

Methods

decodeRequest()

decode a request of json xmlrpc.

public static decodeRequest(string $content) : mixed
Parameters
$content : string
Return values
mixed

decodeResponse()

decode a jsonrpc response.

public static decodeResponse(string $content) : mixed
Parameters
$content : string
Return values
mixed

decoded content

encodeFaultResponse()

encode a jsonrpc error response.

public static encodeFaultResponse(int $code, string $message[, mixed $id = 1 ]) : string
Parameters
$code : int

code error

$message : string

error message

$id : mixed = 1
Return values
string

encoded response

encodeRequest()

create a request content for a jsonrpc call.

public static encodeRequest(string $methodname, array<string|int, mixed> $params[, mixed $id = 1 ]) : string
Parameters
$methodname : string

method of the jsonrcp web service

$params : array<string|int, mixed>

parameters for the methods

$id : mixed = 1
Return values
string

jsonrcp request content

encodeResponse()

encode a jsonrpc response.

public static encodeResponse(array<string|int, mixed> $params[, mixed $id = 1 ]) : string
Parameters
$params : array<string|int, mixed>

returned value

$id : mixed = 1
Return values
string

encoded response

__construct()

private __construct() : mixed
Return values
mixed

Search results