php-json-rpc/tests/sub.php

20 lines
387 B
PHP

<?php
include_once dirname(__DIR__) . '/vendor/autoload.php';
$client = new \JsonRpc\Client([
'app' => 'abc',
'client' => [
'default' => [
'base_uri' => 'http://localhost:8080',
]
],
]);
$client->endpoint('default');
try {
$res = $client->call('math.subtract', ['12', '23', 500]);
} catch (Exception $e) {
var_dump($e->getMessage());
}