Group
Extension

Matches 3

JSON-RPC-Dispatcher ( D/DM/DMCBRIDE/JSON-RPC-Dispatcher-0.0508.tar.gz, DMCBRIDE, 2016; MetaCPAN )
JSON-RPC-Dispatcher/lib/JSON/RPC/Dispatcher.pm ( view source; MetaCPAN )
package JSON::RPC::Dispatcher;
$JSON::RPC::Dispatcher::VERSION = '0.0508';
=head1 NAME

JSON::RPC::Dispatcher - A JSON-RPC 2.0 server.

=head1 VERSION

version 0.0508

=head1 SYNOPSIS

In F<app.psgi>:


 use JSON::RPC::Dispatcher;

 my $rpc = JSON::RPC::Dispatcher->new;

 sub add_em {
    my @params = @_;
    my $sum = 0;
    $sum += $_ for @params;
    return $sum;
 }
 $rpc->register( 'sum', \&add
thod=sum;params=[2,3,5];id=1

Or by posting JSON to it like this:

 {"jsonrpc":"2.0","method":"sum","params":[2,3,5],"id":"1"}

And you'd get back:

 {"jsonrpc":"2.0","result":10,"id":"1"}
 
=head1 DE
JSON-RPC-Dispatcher ( D/DM/DMCBRIDE/JSON-RPC-Dispatcher-0.0508.tar.gz, DMCBRIDE, 2016; MetaCPAN )
JSON-RPC-Dispatcher/lib/JSON/RPC/Dispatcher/App.pm ( view source; MetaCPAN )
package JSON::RPC::Dispatcher::App;
$JSON::RPC::Dispatcher::App::VERSION = '0.0508';
use Moose;
use JSON::RPC::Dispatcher;

=head1 NAME

JSON::RPC::Dispatcher::App - A base class for creating object o
ION

version 0.0508

=head1 SYNOPSIS

Create your module:

 package MyApp;

 use Moose;
 extends 'JSON::RPC::Dispatcher::App';

 sub sum {
    my ($self, @params) = @_;
    my $sum = 0;
    $sum += $_
ented JSON-RPC applications. This is a huge benefit when writing a larger app or suite of applications rather than just exposing a procedure or two. If you build out classes of methods using JSON::RPC
JSON-RPC-Dispatcher ( D/DM/DMCBRIDE/JSON-RPC-Dispatcher-0.0508.tar.gz, DMCBRIDE, 2016; MetaCPAN )
JSON-RPC-Dispatcher/lib/JSON/RPC/Dispatcher/Procedure.pm ( view source; MetaCPAN )
package JSON::RPC::Dispatcher::Procedure;
$JSON::RPC::Dispatcher::Procedure::VERSION = '0.0508';
=head1 NAME

JSON::RPC::Dispatcher::Procedure - The data holder between RPC requests and responses.

=h
ead1 VERSION

version 0.0508

=head1 SYNOPSIS

 use JSON::RPC::Dispatcher::Procedure;

 my $proc = JSON::RPC::Dispatcher::Procedure->new;

 $proc->error_code(300);

 my $method = $proc->method;

=head
----------

=head2 invalid_request ( [ data ] ) 

Sets an Invalid Request error as defined by the JSON-RPC 2.0 spec.

=head3 data 

Optionally set some error data for the error.

=cut

sub invalid_req

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.