php-json-rpc/tests/sub.php

20 lines
387 B
PHP
Raw Normal View History

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