Group
Extension

Matches 1

Catalyst-Plugin-JSONRPC ( M/MI/MIYAGAWA/Catalyst-Plugin-JSONRPC-0.01.tar.gz, MIYAGAWA, 2006; MetaCPAN )
Catalyst-Plugin-JSONRPC/lib/Catalyst/Plugin/JSONRPC.pm ( view source; MetaCPAN )
package Catalyst::Plugin::JSONRPC;

use strict;
our $VERSION = '0.01';

use JSON ();

sub json_rpc {
    my $c = shift;
    my $attrs = @_ > 1 ? {@_} : $_[0];

    my $body    = $c->req->body;
    my 
q = JSON::jsonToObj($content) };
    if ($@ || !$req) {
        $c->log->debug(qq/Invalid JSON-RPC request: "$@"/);
        $c->res->content_type('text/javascript+json');
        $c->res->body(JSON::o
bjToJson({
            result => undef,
            error  => 'Invalid request',
        }));
        return 0;
    }

    my $res = 0;

    my $method = $attrs->{method} || $req->{method};
    if ($m

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