json-rpc-php icon indicating copy to clipboard operation
json-rpc-php copied to clipboard

jsonRPCClient with Assoc. Array Parameters

Open chaintng opened this issue 11 years ago • 0 comments

I need to send associative array as parameter via json rpc

for example.

{"sendDate":"2013-07-06", "packageId":1}

But if i type like $myExample->getContent(array('sendDate' => '2013-06-17', 'packageId' => 1));

the $params wil show [{"sendDate":"2013-07-06", "packageId":1}]

So it not correct.

I think there must be a fix near here.

    if (is_array($params)) {
        // no keys
        $params = array_values($params);

using array_pop instead of array_values work fine.

Please advise

chaintng avatar Jun 25 '13 06:06 chaintng