edgetelemetrics/php-json-rpc
最新稳定版本:v1.2.2
Composer 安装命令:
composer require edgetelemetrics/php-json-rpc
包简介
JSON-RPC helper classes for PHP
关键字:
README 文档
README
This library contains classes to construct JSON RPC notification, request, response and error objects.
Additionally there is a ReactPHP stream decoder included which will process JSON RPC request and responses encoded via NDJSON.
https://www.jsonrpc.org/specification
Quickstart
Create a Request on the client
<?php use EdgeTelemetrics\JSON_RPC\Request; $request = new Request('ping', [], 'requestId'); $packet = json_encode($request); // Send $packet to Server
Server side
<?php //Process request // Create the response from the request to pre-fill ID $response = new Response::createFromRequest($request); $response->setResult('pong'); $packet = json_encode($response); // Send $packet back to Client
统计信息
- 总下载量: 3.85k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-20