PHPackages                             procurios/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. procurios/json-rpc

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

procurios/json-rpc
==================

JSON-RPC 2.0 server in PHP

v2.0.0(2y ago)1101MITPHPPHP &gt;=8.0CI failing

Since Jan 5Pushed 1y ago4 watchersCompare

[ Source](https://github.com/procurios/JsonRpc)[ Packagist](https://packagist.org/packages/procurios/json-rpc)[ Docs](https://github.com/procurios/JsonRpc)[ RSS](/packages/procurios-json-rpc/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (6)Versions (4)Used By (0)

JSON-RPC 2.0 Server supporting PSR-7
====================================

[](#json-rpc-20-server-supporting-psr-7)

[![Build Status](https://camo.githubusercontent.com/9d487ae14ca8e660ec44c176df40b588838c28eb2a8efa5e238b7c1824b282f1/68747470733a2f2f6170702e7472617669732d63692e636f6d2f70726f637572696f732f4a736f6e5270632e7376673f6272616e63683d6d6173746572)](https://app.travis-ci.com/github/procurios/JsonRpc)[![Coverage Status](https://camo.githubusercontent.com/10a93c86bef641c5c9827cde3db9e3ac38f0da02c83b7711241195b43615361f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f70726f637572696f732f4a736f6e5270632f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/procurios/JsonRpc?branch=master)

Server
------

[](#server)

The server is a *complete* implementation of the [JSON-RPC 2.0 specification](http://www.jsonrpc.org/specification). The server will expose public methods of an object or a static class which can be optionally limited using an interface or specific parent class.

To encourage interface segregation there is no support for other methods like closures or global functions.

### Features

[](#features)

- Full specification including notifications, both parameters by name and by position and batch requests
- Default values are used for skipped arguments
- Variadic arguments are supported
- PSR-7 compatible: This server can directly handle implementations of `Psr\Http\Message\ServerRequestInterface`, returning an implementation of `Psr\Http\Message\ResponseInterface`, as defined in [PSR-7](http://www.php-fig.org/psr/psr-7/)

### Requirements

[](#requirements)

PHP &gt;= 8.0

Example
-------

[](#example)

### Subject classes

[](#subject-classes)

#### MyInterface

[](#myinterface)

```
