|
NAMEJSON::RPC::Server - Perl implementation of JSON-RPC sever SYNOPSIS # CGI version
use JSON::RPC::Legacy::Server::CGI;
my $server = JSON::RPC::Legacy::Server::CGI->new;
$server->dispatch_to('MyApp')->handle();
# Apache version
# In apache conf
PerlRequire /your/path/start.pl
PerlModule MyApp
<Location /jsonrpc/API>
SetHandler perl-script
PerlResponseHandler JSON::RPC::Legacy::Server::Apache
PerlSetVar dispatch "MyApp"
PerlSetVar return_die_message 0
</Location>
# Daemon version
use JSON::RPC::Legacy::Server::Daemon;
JSON::RPC::Legacy::Server::Daemon->new(LocalPort => 8080);
->dispatch({'/jsonrpc/API' => 'MyApp'})
->handle();
# FastCGI version
use JSON::RPC::Legacy::Server::FastCGI;
my $server = JSON::RPC::Legacy::Server::FastCGI->new;
$server->dispatch_to('MyApp')->handle();
DESCRIPTIONGets a client request. Parses its JSON data. Passes the server object and the object decoded from the JSON data to your procedure (method). Takes your returned value (scalar or arrayref or hashref). Sends a response. Well, you write your procedure code only. METHODS
RESERVED PROCEDUREWhen a client call a procedure (method) name 'system.foobar', JSON::RPC::Legacy::Server look up MyApp::system::foobar. <http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html#ProcedureCall> <http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html#ServiceDescription> There is JSON::RPC::Legacy::Server::system::describe for default response of 'system.describe'. SEE ALSOJSON <http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html> <http://json-rpc.org/wiki/specification> AUTHORMakamaka Hannyaharamitu, <makamaka[at]cpan.org> COPYRIGHT AND LICENSECopyright 2007-2008 by Makamaka Hannyaharamitu This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|