{"id":20795650,"url":"https://github.com/graze/guzzle-jsonrpc","last_synced_at":"2025-04-04T20:10:09.624Z","repository":{"id":9168244,"uuid":"10966505","full_name":"graze/guzzle-jsonrpc","owner":"graze","description":"JSON-RPC 2.0 client for Guzzle","archived":false,"fork":false,"pushed_at":"2023-02-15T15:57:32.000Z","size":154,"stargazers_count":93,"open_issues_count":6,"forks_count":60,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-28T19:08:28.235Z","etag":null,"topics":["guzzle","php"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/graze/guzzle-jsonrpc","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/graze.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-06-26T11:48:04.000Z","updated_at":"2024-09-10T01:47:08.000Z","dependencies_parsed_at":"2024-06-18T11:41:16.418Z","dependency_job_id":null,"html_url":"https://github.com/graze/guzzle-jsonrpc","commit_stats":{"total_commits":107,"total_committers":11,"mean_commits":9.727272727272727,"dds":0.2149532710280374,"last_synced_commit":"45ed4525d55b2aecf1b5ffb7848b7d4f946e519c"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graze%2Fguzzle-jsonrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graze%2Fguzzle-jsonrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graze%2Fguzzle-jsonrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graze%2Fguzzle-jsonrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graze","download_url":"https://codeload.github.com/graze/guzzle-jsonrpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242678,"owners_count":20907134,"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","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":["guzzle","php"],"created_at":"2024-11-17T16:23:04.860Z","updated_at":"2025-04-04T20:10:09.602Z","avatar_url":"https://github.com/graze.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [ABANDONED] Guzzle JSON-RPC\n\n[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\n### This is no longer supported, please consider forking this repository to make any desired changes.\n\n[![Master branch build status][ico-build]][travis]\n[![Coverage Status][ico-coverage]][coverage]\n[![Quality Score][ico-quality]][quality]\n[![Published version][ico-package]][package]\n[![PHP ~5.5][ico-engine]][lang]\n[![MIT Licensed][ico-license]][license]\n\nThis library implements [JSON-RPC 2.0][jsonrpc] for the Guzzle HTTP client. We\ntry to support all commonly used versions of Guzzle including:\n\n- [GuzzleHTTP 6][guzzle] on [`master`][branch-master] branch, `^3.0` releases\n- [GuzzleHTTP 5][guzzle] on [`guzzle-5`][branch-5] branch, `^2.1` releases\n- [GuzzleHTTP 4][guzzle] on [`guzzle-4`][branch-4] branch, `2.0.*` releases\n- [Guzzle 3][guzzle-3] on [`guzzle-3`][branch-3] branch, `^1.0` releases\n\nIt can be installed in whichever way you prefer, but we recommend [Composer][package].\n\n```json\n{\n    \"require\": {\n        \"graze/guzzle-jsonrpc\": \"~3.0\"\n    }\n}\n```\n\n## Documentation\n\n```php\n\u003c?php\nuse Graze\\GuzzleHttp\\JsonRpc\\Client;\n\n// Create the client\n$client = Client::factory('http://localhost:8000');\n\n// Send a notification\n$client-\u003esend($client-\u003enotification('method', ['key'=\u003e'value']));\n\n// Send a request that expects a response\n$client-\u003esend($client-\u003erequest(123, 'method', ['key'=\u003e'value']));\n\n// Send a batch of requests\n$client-\u003esendAll([\n    $client-\u003erequest(123, 'method', ['key'=\u003e'value']),\n    $client-\u003erequest(456, 'method', ['key'=\u003e'value']),\n    $client-\u003enotification('method', ['key'=\u003e'value'])\n]);\n```\n\n### Async requests\n\nAsynchronous requests are supported by making use of the\n[Guzzle Promises][guzzle-promise] library; an implementation of\n[Promises/A+][promise].\n\n```php\n\u003c?php\nuse Graze\\GuzzleHttp\\JsonRpc\\Client;\n\n// Create the client\n$client = Client::factory('http://localhost:8000');\n\n// Send an async notification\n$promise = $client-\u003esendAsync($client-\u003enotification('method', ['key'=\u003e'value']));\n$promise-\u003ethen(function () {\n    // Do something\n});\n\n// Send an async request that expects a response\n$promise = $client-\u003esendAsync($client-\u003erequest(123, 'method', ['key'=\u003e'value']));\n$promise-\u003ethen(function ($response) {\n    // Do something with the response\n});\n\n// Send a batch of requests\n$client-\u003esendAllAsync([\n    $client-\u003erequest(123, 'method', ['key'=\u003e'value']),\n    $client-\u003erequest(456, 'method', ['key'=\u003e'value']),\n    $client-\u003enotification('method', ['key'=\u003e'value'])\n])-\u003ethen(function ($responses) {\n    // Do something with the list of responses\n});\n```\n\n### Throw exception on RPC error\n\nYou can throw an exception if you receive an RPC error response by adding the\noption `[rpc_error =\u003e true]` in the client constructor.\n\n```php\n\u003c?php\nuse Graze\\GuzzleHttp\\JsonRpc\\Client;\nuse Graze\\GuzzleHttp\\JsonRpc\\Exception\\RequestException;\n\n// Create the client with the `rpc_error`\n$client = Client::factory('http://localhost:8000', ['rpc_error'=\u003etrue]);\n\n// Create a request\n$request = $client-\u003erequest(123, 'method', ['key'=\u003e'value']);\n\n// Send the request\ntry {\n    $client-\u003esend($request);\n} catch (RequestException $e) {\n    die($e-\u003egetResponse()-\u003egetRpcErrorMessage());\n}\n```\n\n### Contributing\n\nWe accept contributions to the source via Pull Request,\nbut passing unit tests must be included before it will be considered for merge.\n\n```bash\n~ $ make deps\n~ $ make lint test\n```\n\n### License\n\nThe content of this library is released under the **MIT License** by\n**Nature Delivered Ltd**.\n\nYou can find a copy of this license at\n[mit][mit] or in [`LICENSE`][license]\n\n\u003c!-- Links --\u003e\n[mit]: http://www.opensource.org/licenses/mit\n[travis]: https://travis-ci.org/graze/guzzle-jsonrpc\n[lang]: http://php.net\n[package]: https://packagist.org/packages/graze/guzzle-jsonrpc\n[coverage]: https://scrutinizer-ci.com/g/graze/guzzle-jsonrpc/code-structure\n[quality]: https://scrutinizer-ci.com/g/graze/guzzle-jsonrpc\n[ico-license]: http://img.shields.io/packagist/l/graze/guzzle-jsonrpc.svg?style=flat\n[ico-package]: http://img.shields.io/packagist/v/graze/guzzle-jsonrpc.svg?style=flat\n[ico-build]: http://img.shields.io/travis/graze/guzzle-jsonrpc/master.svg?style=flat\n[ico-engine]: http://img.shields.io/badge/php-~5.5-8892BF.svg?style=flat\n[ico-coverage]: https://img.shields.io/scrutinizer/coverage/g/graze/guzzle-jsonrpc.svg?style=flat\n[ico-quality]: https://img.shields.io/scrutinizer/g/graze/guzzle-jsonrpc.svg?style=flat\n[vagrant]: http://vagrantup.com\n[jsonrpc]: http://jsonrpc.org/specification\n[guzzle]: https://github.com/guzzle/guzzle\n[promise]: https://promisesaplus.com\n[guzzle-3]: https://github.com/guzzle/guzzle3\n[guzzle-promise]: https://github.com/guzzle/promises\n[branch-3]: https://github.com/graze/guzzle-jsonrpc/tree/guzzle-3\n[branch-4]: https://github.com/graze/guzzle-jsonrpc/tree/guzzle-4\n[branch-5]: https://github.com/graze/guzzle-jsonrpc/tree/guzzle-5\n[branch-master]: https://github.com/graze/guzzle-jsonrpc\n[license]: LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraze%2Fguzzle-jsonrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraze%2Fguzzle-jsonrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraze%2Fguzzle-jsonrpc/lists"}