Giter VIP home page Giter VIP logo

cgi-jsonrpc's Introduction

NAME
    CGI::JSONRPC - CGI handler for JSONRPC

SYNOPSIS
      use CGI;
      use CGI::JSONRPC;
      my $cgi = new CGI;
      CGI::JSONRPC->handler($cgi);
      exit;
  
DESCRIPTION
    CGI::JSONRPC is a pole for perl.

    CGI::JSONRPC implements the JSONRPC protocol as defined at
    <http://www.json-rpc.org/>. When a JSONRPC request is received by this
    handler, it is translated into a method call. The method and it's
    arguments are determined by the JSON payload coming from the browser,
    and the package to call this method on is determined by the
    "JSONRPC_Class" apache config directive.

    A sample "dispatcher" module is supplied, CGI::JSONRPC::Dispatcher

    Note: *This documentation is INCOMPLETE and this is an alpha release.
    The interface is somewhat stable and well-tested, but other changes may
    come as I work in implementing this on my website.*

USAGE
    When contacted with a GET request, CGI::JSONRPC will reply with the
    contents of JSONRPC.js, which contains code that can be used to create
    JavaScript classes that can communicate with their Perl counterparts.
    See the /examples/hello.html file for some sample JavaScript that uses
    this library, and /examples/httpd.conf for the corresponding Perl.

    When contacted with a POST request, CGI::JSONRPC will attempt to process
    and dispatch a JSONRPC request. If a valid JSONRPC request was sent in
    the POST data, the dispatcher class will be called, with the following
    arguments:

    $class
        Just like any other class method, the first argument passed in will
        be name of the class being invoked.

    $id The object ID string from the JSONRPC request. In accordance with
        the json-rpc spec, your response will only be sent to the client if
        this value is defined.

    @params
        All further arguments to the method will be the arugments passed to
        the JSONRPC constructor. It is expected to be a hash of key value
        option pairs.

    If the client specified an "id", your method's return value will be
    serialized into a JSON array and sent to the client as the "result"
    section of the JSONRPC response.

  The default dispatcher
    The default dispatcher adds another layer of functionality; it expects
    the first argument in @params to be the name of the class the method is
    being invoked on. See CGI::JSONRPC::Dispatcher for more details on that.

AUTHOR
    Tyler "Crackerjack" MacDonald <[email protected]> and David Labatte
    <[email protected]>.

    A lot of the JavaScript code was borrowed from Ingy döt Net's Jemplate
    package.

LICENSE
    Copyright 2008 Tyler "Crackerjack" MacDonald <[email protected]> and
    David Labatte <[email protected]>

    This is free software; You may distribute it under the same terms as
    perl itself.

SEE ALSO
    The "examples" directory (examples/httpd.conf and examples/hello.html),
    JSON::Syck, <http://www.json-rpc.org/>.

cgi-jsonrpc's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.