Download the PHP package alanbem/josser without Composer
On this page you can find all versions of the php package alanbem/josser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package josser
Josser - JSON-RPC client for PHP 5.3+
JSON-RPC? What is it?
JSON-RPC is a stateless, light-weight remote procedure call protocol encoded in JSON. It is a very simple protocol, defining only a handful of data types and commands.
Which specification of JSON-RPC does Josser support?
Josser supports [JSON-RPC 1.0] (http://json-rpc.org/wiki/specification) and [revised JSON-RPC 2.0] (http://www.jsonrpc.org/specification). Unfortunately only client-server connections are possible with Josser - albeit JSON-RPC 1.0 was designed as P2P - due to PHP limitations.
It is worth to mention that Josser's architecture allows to plug your own JSON-RPC flavours or implement existing semi-standardized JSON-RPC protocols e.g. abandoned JSON-RPC 1.1WD.
Transport mechanism
As specification (both 1.0 and 2.0) states, JSON-RPC is transport agnostic. Josser sticks to that and allows to use http, sockets, tcp/ip or anything else your project requires (like post-it notes on a fridge :D). Currently only http transport is implemented.
Documentation
Usage
Invoking remote methods is fairly simple:
If remote method does not return anything, notifications are what you need:
Error handling
Josser informs about errors through set of exceptions.
For convenience catch-all exception exists.
Request objects
When you call remote procedures, those calls are internally translated into generic request objects.
As you can see, you can work with those low-level objects directly but downside of this approach is that you must provide your own id for every request. By default Client::request() generates this id for you on its own. Also remember that Client::call() does not return result directly - it return response object instead. To get to underlying result data use Response::getResult() like this:
Notice the possibility of creating your own, project specific, request objects.
About
Requirements
PHP >= 5.3
Submitting bugs and feature requests
Bugs and feature request are tracked on Github
Author
Alan Gabriel Bem - [email protected]
License
Josser is licensed under the MIT License - see the LICENSE file for details
All versions of josser with dependencies
guzzlehttp/guzzle Version ^5.0|^6.0
symfony/serializer Version ^2.0|^3.0|^4.0|^5.0