timiki/

简单的HTTP JSON-RPC客户端

4.1.0 2023-07-09 21:32 UTC

This package is auto-updated.

Last update: 2024-09-10 00:46:17 UTC


README

安装

composer require timiki/rpc-client

选项

attempts_on_error (int) - 连接或响应错误时的尝试次数(默认:10)

attempts_on_response_error (bool) - 在响应错误时尝试(默认:false)

attempts_delay (int) - 尝试之间的延迟(毫秒)(默认:1000)

response_on_connection_exception (bool) - 如果设置为true,客户端在连接异常时返回JsonResponse(默认:true)

异步

JSON-RPC Http客户端使用 guzzlehttp/promises 来调用异步函数

callAsync(string $method, array $params = [], array $headers = []): Promise

noticeAsync(string $method, array $params = [], array $headers = []): Promise