PHPackages                             muvon/kiss-json-rpc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. muvon/kiss-json-rpc

ActiveLibrary[HTTP &amp; Networking](/categories/http)

muvon/kiss-json-rpc
===================

KISS implementation of JSON RPC client

0.5.1(5y ago)0371MITPHP

Since Mar 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Muvon/php-kiss-json-rpc)[ Packagist](https://packagist.org/packages/muvon/kiss-json-rpc)[ RSS](/packages/muvon-kiss-json-rpc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (15)Used By (1)

php-kiss-json-rpc
=================

[](#php-kiss-json-rpc)

KISS implementation of lib to work with JSON RPC protocol

Example of usage
----------------

[](#example-of-usage)

Here is fast snippets of how to use lib

```
use Muvon\KISS\JsonRpc;
$rpc = JsonRpc::creete(
  'http://rpc-server.ip.or.host',
  'username',
  'password'
);

// Call one method
[$err, $result] = $rpc->call('method', [1, 2, 3]);

// Call several methods asycn
$multi = [
  ['method1', ['param1', 'param2']],
  ['method2', ['param1', 'param2']],
];
[$err, $results] = $rpc->callMulti($multi);

// Call method using magic
[$err, $result] = $rpc->method_name(['param1', 'param2']);
```

Methods
-------

[](#methods)

### create(string $url, ?string $username = null, ?string $password = null)

[](#createstring-url-string-username--null-string-password--null)

This method creates instance of object with given params. If RPC requruires authentification you need to pass username and password. Otherwise it can be omitted.

All requests made by lib is POST and JSON with Connection: close.

```
use Muvon\KISS\JsonRpc;

$rpc = JsonRpc::create($url);
```

### call(string $method, array $params = \[\])

[](#callstring-method-array-params--)

This method do simple call to RPC with given method and params.

It returns common structure as array: \[error, result\]. Where is error is string presentation of error or null and result is array of result or null or even mixed value in case of we has error and want to give more info about it we send it to result var.

```
[$err, $result] = $rpc->call('getblockcount');
```

### callMulti(array $multi)

[](#callmultiarray-multi)

This method is way the same as call method but receive list of commands as argument and returns same structure but result contains list of results. In case if one or more requests failed we throw Error in this method and catch itself to return error message.

```
[$err, $results] = $rpc->callMulti(
  ['getblockhash', [1]],
  ['getblockhash', [2]],
);

// var_dump($results)
// [ array of response1, array of response2 ]
```

### magic methods

[](#magic-methods)

You can call any method of rpc just using magic and same rpc name method to call. It will route you to call method.

```
$rpc->getblockhash(1);
```

### setOption(string $opt, mixed $value)

[](#setoptionstring-opt-mixed-value)

This method allows you to change available options before use of lib.

Available options are:

- **OPT\_CONNECT\_TIMEOUT** - int time to wait to connect to host
- **OPT\_TIMEOUT** - int time to wait for response in connection
- **OPT\_SSL\_VERIFY** - int 0 skip verification as default or 1 check SSL cert

Test coverage
-------------

[](#test-coverage)

- Simple single request with call
- Simple multi requests
- Send correct params

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

14

Last Release

1872d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/63024506f19e213d456eab6179ffa1e95d5f2b4ee19aa06063f754a4cb3f113d?d=identicon)[muvon](/maintainers/muvon)

---

Top Contributors

[![donhardman](https://avatars.githubusercontent.com/u/59067742?v=4)](https://github.com/donhardman "donhardman (43 commits)")

---

Tags

curljsonjsonrpckisslibphprequestrpchttprequestjsoncurlrpcjson-rpc

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/muvon-kiss-json-rpc/health.svg)

```
[![Health](https://phpackages.com/badges/muvon-kiss-json-rpc/health.svg)](https://phpackages.com/packages/muvon-kiss-json-rpc)
```

###  Alternatives

[graze/guzzle-jsonrpc

JSON-RPC 2.0 client for Guzzle

981.2M24](/packages/graze-guzzle-jsonrpc)[datto/json-rpc-http

HTTP client and server for JSON-RPC 2.0

66525.9k5](/packages/datto-json-rpc-http)[aplus/http-client

Aplus Framework HTTP Client Library

2161.6M1](/packages/aplus-http-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
