Download the PHP package vaderangry/php-json-rpc without Composer
On this page you can find all versions of the php package vaderangry/php-json-rpc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vaderangry/php-json-rpc
More information about vaderangry/php-json-rpc
Files in vaderangry/php-json-rpc
Package php-json-rpc
Short Description Flexible JSON-RPC2 server/client implementation for PHP7
License MIT
Homepage https://github.com/vaderangry/PhpJsonRpc
Informations about the package php-json-rpc
PhpJsonRpc
Flexible JSON-RPC2 server/client implementation for PHP7.
Features
- JSON-RPC 2.0 full conformance (batch requests, notification, positional and named arguments, etc).
- Quick-start with default routing based on php namespaces.
- Flexible custom routing for your requirements.
- The mechanism of intercepting requests and responses through handlers.
- Automatic casting types in requests and responses.
- Fully unit tested.
Installation
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Documentation
- Server usage
- Client usage
Basic usage
Server
The example of quick-start:
Method Math::pow
by default will mapped to method Math.pow
in JSON-RPC2 terms. Request example:
The example of custom method mapping:
Now Math::pow
will be mapped to pow
. Request example:
Client
Single request:
Single request with exception server error mode:
Batch request:
All unit of result stored at the same position of call. Server error present null
object.
Batch request with exception server error mode:
With exception mode server error present JsonRpcException
object.
Exception will not throw for saving other units of result.
The example with personal custom headers in request: