{"id":21045163,"url":"https://github.com/fullpipe/php-json-rpc-client","last_synced_at":"2025-10-08T06:37:30.682Z","repository":{"id":54988476,"uuid":"239168617","full_name":"fullpipe/php-json-rpc-client","owner":"fullpipe","description":"JSON-RPC 2.0 PHP client.","archived":false,"fork":false,"pushed_at":"2021-01-17T13:20:08.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-21T18:44:30.402Z","etag":null,"topics":["json-rpc","json-rpc-client"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fullpipe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-08T16:56:39.000Z","updated_at":"2021-01-17T13:19:31.000Z","dependencies_parsed_at":"2022-08-14T08:20:17.909Z","dependency_job_id":null,"html_url":"https://github.com/fullpipe/php-json-rpc-client","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/fullpipe/php-json-rpc-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullpipe%2Fphp-json-rpc-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullpipe%2Fphp-json-rpc-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullpipe%2Fphp-json-rpc-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullpipe%2Fphp-json-rpc-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fullpipe","download_url":"https://codeload.github.com/fullpipe/php-json-rpc-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullpipe%2Fphp-json-rpc-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278903012,"owners_count":26065784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json-rpc","json-rpc-client"],"created_at":"2024-11-19T14:20:20.936Z","updated_at":"2025-10-08T06:37:30.645Z","avatar_url":"https://github.com/fullpipe.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON-RPC 2.0 PHP client\n\n## Install\n\n```\ncomposer require fullpipe/php-json-rpc-client\n```\n\n## Usage\n\n```php\nuse Fullpipe\\RpcClient\\Client;\nuse Fullpipe\\RpcClient\\Error\\AppError;\nuse Fullpipe\\RpcClient\\Error\\MethodNotFound;\nuse Fullpipe\\RpcClient\\Error\\InvalidParams;\n...\n\n$client = new Client('https://api.server/rpc', [\n    'retries' =\u003e 0,\n    'delay' =\u003e 500,\n    'http' =\u003e ['timeout' =\u003e 1],\n]);\n\n// Simple call\n$userData = $client-\u003ecall('user.get', ['id' =\u003e 123]);\n\n// Simple call with single retry\n$userData = $client-\u003eretryOnce()-\u003ecall('user.get', ['id' =\u003e 123]);\n\n// Call and catch application error\ntry {\n    $userData = $client-\u003ecall('user.get', ['id' =\u003e 123]);\n} catch (AppError $e) {\n    if ($e-\u003egetCode() !== 404) {\n        throw $e;\n    }\n\n    $userData = $this-\u003ecreateNewUser();\n} catch (MethodNotFound | InvalidParams $e) {\n    $this-\u003esentry-\u003ecatchException($e);\n}\n```\n\n## Configuration\n\n### Default\n\nBy default retries disabled. And CurlHandler used as handler for guzzle.\n\n```php\n[\n    'retries' =\u003e 0,\n    'retryCodes' =\u003e [500, 502, 503],\n    'delay' =\u003e 500,\n    'http' =\u003e ['timeout' =\u003e 1], // options for CurlHandler\n]\n```\n\n### Custom handler\n\nYou could use you own handler. For tests for example.\n\n```php\nuse GuzzleHttp\\Handler\\MockHandler;\n...\n\n$handler = new MockHandler([\n    new Response(200, [], \\json_encode([\n        'jsonrpc' =\u003e '2.0',\n        'result' =\u003e 'foo',\n        'id' =\u003e 1,\n    ])),\n]);\n\n$client = new Client('https://api.server/rpc', [\n    'handler' =\u003e $handler\n]);\n```\n\n### Retry codes\n\nYou could overwrite retryCode to retry on RPC errors\n\n```\n[\n    'retries' =\u003e 1,\n    'retryCodes' =\u003e [500, 502, 503, -32603],\n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffullpipe%2Fphp-json-rpc-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffullpipe%2Fphp-json-rpc-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffullpipe%2Fphp-json-rpc-client/lists"}