JSONRPC 1.0.0

Client extends Client
in package
uses JsonRpcVersionAware

Tags
todo

the JSON proposed RFC states that when making json calls, we should specify an 'accept: application/json' http header. Currently, we either do not output an 'accept' header or specify 'any' (in curl mode)

Table of Contents

Constants

OPT_JSONRPC_VERSION  = 'jsonrpc_version'

Properties

$request_charset_encoding  : mixed
$return_type  : mixed
$extra_options  : mixed
$jsonrpc_version  : string|null
$no_multicall  : mixed
$requestClass  : mixed
$responseClass  : mixed

Methods

__construct()  : mixed
getJsonRpcVersion()  : string|null
getOption()  : mixed
send()  : Response|true|array<string|int, Response>
setJsonRpcVersion()  : void
setOption()  : mixed
_try_multicall()  : array<string|int, Response>|Response
Attempt to boxcar $reqs via a batch call.
fixErrorCodeIfNeeded()  : void

Constants

OPT_JSONRPC_VERSION

public mixed OPT_JSONRPC_VERSION = 'jsonrpc_version'

Properties

$request_charset_encoding

public mixed $request_charset_encoding = 'UTF-8'

$return_type

public mixed $return_type = \PhpXmlRpc\JsonRpc\Helper\Parser::RETURN_JSONRPCVALS

$extra_options

protected static mixed $extra_options = array(self::OPT_JSONRPC_VERSION)

$no_multicall

protected mixed $no_multicall = null

$requestClass

protected static mixed $requestClass = '\PhpXmlRpc\JsonRpc\Request'

$responseClass

protected static mixed $responseClass = '\PhpXmlRpc\JsonRpc\Response'

Methods

__construct()

public __construct(mixed $path[, mixed $server = '' ][, mixed $port = '' ][, mixed $method = '' ]) : mixed
Parameters
$path : mixed
$server : mixed = ''
$port : mixed = ''
$method : mixed = ''

getJsonRpcVersion()

public getJsonRpcVersion() : string|null
Return values
string|null

NULL means let the global var PhpJsonRpc::$defaultJsonRpcVersion decide

getOption()

public getOption(string $name) : mixed
Parameters
$name : string

see all the OPT_ constants

Tags
throws
ValueErrorException

on unsupported option

send()

public send(Request|array<string|int, Request>|string $req[, int $timeout = 0 ][, string $method = '' ]) : Response|true|array<string|int, Response>
Parameters
$req : Request|array<string|int, Request>|string

NB: when sending an empty array, an empty array is returned, even though, according to the spec, an error response is returned by the server

$timeout : int = 0

deprecated

$method : string = ''

deprecated

Return values
Response|true|array<string|int, Response>

true for notification calls, if the server returns an empty http response body

setJsonRpcVersion()

public setJsonRpcVersion(string|null $jsonrpcVersion) : void
Parameters
$jsonrpcVersion : string|null

Use NULL to let the global var PhpJsonRpc::$defaultJsonRpcVersion decide

setOption()

public setOption(mixed $name, mixed $value) : mixed
Parameters
$name : mixed
$value : mixed

_try_multicall()

Attempt to boxcar $reqs via a batch call.

protected _try_multicall(array<string|int, Request$reqs, int $timeout, string $method) : array<string|int, Response>|Response
Parameters
$reqs : array<string|int, Request>
$timeout : int
$method : string
Return values
array<string|int, Response>|Response

a single Response when the call returned a fault / does not conform to what we expect from a multicall response


        
On this page

Search results