JSON::RPC::Common::Procedure::Call - JSON RPC Procedure Call base class.
use JSON::RPC::Common::Procedure::Call; my $req = JSON::RPC::Common::Procedure::Call->inflate({ ... }); warn "HALLO JSONRPC VERSION " . $req->version;
A JSON-RPC Procedure Call (ed: *rolls eys*, what was wrong with "request"?) is either a notification or a method invocation in JSON-PRC.
See http://json-rpc.org/wiki/specification for more details.
All attributes are read only unless otherwise specified.
The request ID.
Used to correlate a request to a response.
The name of the method to invoke.
Returns a reference to the parameters hash or array.
The classes to instantiate the response objects.
These vary per subclass.
A factory constructor. Delegates to new on a subclass based on the protocol version.
new
This is the recommended constructor.
Flatten to JSON data
The actual constructor.
Not intended for normal use on this class, you should use a subclass most of the time.
Calling JSON::RPC::Common::Procedure::Call->new will construct a call with an undefined version, which cannot be deflated (and thus sent over the wire). This is still useful for testing your own code's RPC hanlding, so this is not allowed.
JSON::RPC::Common::Procedure::Call->new
Dereferences params regardless of representation.
params
Returns a list of positionals or a key/value list.
Create a new JSON::RPC::Common::Procedure::Return with or without an error.
Whether this request is a notification (a method that does not need a response).
Whether this request is a JSON-RPC 1.1 service method (e.g. system.describe).
system.describe
This method is always false for 1.0 and 2.0.
A convenience method to invoke the call on $obj and create a new return with the return value.
$obj
To install JSON::RPC::Common, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JSON::RPC::Common
CPAN shell
perl -MCPAN -e shell install JSON::RPC::Common
For more information on module installation, please visit the detailed CPAN module installation guide.