Request
extends Request
in package
uses
SerializerAware
Table of Contents
Properties
- $content_type : mixed
- $currentIdCounter : mixed
- $currentIdPrefix : mixed
- $id : mixed
- $jsonrpc_version : string
- $paramnames : array<string|int, string>
- $serializer : mixed
Methods
- __construct() : mixed
- addParam() : bool
- getJsonRpcVersion() : string
- getParamNames() : array<string|int, string>
- getParser() : Parser
- Reimplemented to make us use the correct parser type.
- getSerializer() : mixed
- id() : mixed
- parseResponse() : Response
- Parse the json-rpc response contained in the string $data and return a jsonrpcresp object.
- setJsonRpcVersion() : void
- setSerializer() : mixed
- generateId() : mixed
Properties
$content_type
public
mixed
$content_type
= 'application/json'
$currentIdCounter
protected
static mixed
$currentIdCounter
= 1
$currentIdPrefix
protected
static mixed
$currentIdPrefix
= ''
$id
protected
mixed
$id
= null
$jsonrpc_version
protected
string
$jsonrpc_version
= \PhpXmlRpc\JsonRpc\PhpJsonRpc::VERSION_2_0
$paramnames
protected
array<string|int, string>
$paramnames
= array()
$serializer
protected
static mixed
$serializer
Methods
__construct()
public
__construct(string $methodName[, array<string|int, Value> $params = array() ][, mixed $id = null ]) : mixed
Parameters
- $methodName : string
-
the name of the method to invoke
- $params : array<string|int, Value> = array()
-
array of parameters to be passed to the method (xmlrpcval objects)
- $id : mixed = null
-
the id of the json-rpc request. NB: a NULL id is allowed, in which case an unique id will be generated. To send notifications, use the Notification class
addParam()
public
addParam(mixed $param[, string|null $name = null ]) : bool
Parameters
- $param : mixed
- $name : string|null = null
Return values
boolgetJsonRpcVersion()
public
getJsonRpcVersion() : string
Return values
stringgetParamNames()
public
getParamNames() : array<string|int, string>
Return values
array<string|int, string>getParser()
Reimplemented to make us use the correct parser type.
public
getParser() : Parser
Return values
ParsergetSerializer()
public
getSerializer() : mixed
id()
public
id() : mixed
parseResponse()
Parse the json-rpc response contained in the string $data and return a jsonrpcresp object.
public
parseResponse([string $data = '' ][, bool $headersProcessed = false ][, string $returnType = Parser::RETURN_JSONRPCVALS ]) : Response
Parameters
- $data : string = ''
-
the json-rpc response, possibly including http headers
- $headersProcessed : bool = false
-
when true prevents parsing HTTP headers for interpretation of content-encoding and conseuqent decoding
- $returnType : string = Parser::RETURN_JSONRPCVALS
-
decides return type, i.e. content of response->value(). Either 'jsonrpcvals', 'json' or 'phpvals'
Tags
Return values
ResponsesetJsonRpcVersion()
public
setJsonRpcVersion(string $jsonrpcVersion) : void
Parameters
- $jsonrpcVersion : string
setSerializer()
public
static setSerializer(mixed $serializer) : mixed
Parameters
- $serializer : mixed
generateId()
protected
generateId() : mixed