Group
Extension

Matches 4

Dancer-Plugin-RPC ( A/AB/ABELTJE/Dancer-Plugin-RPC-1.11.tar.gz, ABELTJE, 2023; MetaCPAN )
Dancer-Plugin-RPC/lib/Dancer/RPCPlugin/DefaultRoute.pm ( view source; MetaCPAN )
 configming to spec: $@"

=item B<application/json>

If the B<body> is valid JSONRPC (ie. is has a I<'jsonrpc': '2.0'> field/value),
the response is a JSONRPC-error:

    code => -32601
    message =>
 "Method '%s' not found"

If the B<body> is I<not> valid JSONRPC, the response is a generic json struct:

    'error': {
        'code':  -32601,
        'message': "Method '$request->path' not found"
elsif ( $content_type eq 'application/json' ) {
            content_type('application/json');

            my $request = request->body
                ? from_json(request->body, {allow_nonref => 1})
 
Dancer-Plugin-RPC ( A/AB/ABELTJE/Dancer-Plugin-RPC-1.11.tar.gz, ABELTJE, 2023; MetaCPAN )
Dancer-Plugin-RPC/lib/Dancer/Plugin/RPC/JSONRPC.pm ( view source; MetaCPAN )
:Plugin::RPC::JSONRPC;
use v5.10;
use Dancer ':syntax';
use Dancer::Plugin;
use Scalar::Util 'blessed';
use Time::HiRes 'time';

our $VERSION = '1.09';

use constant PLUGIN_NAME => 'jsonrpc';

use Dan
    debug("Starting jsonrpc-handler build: ", $lister);
    my $handle_call = sub {
        my ($ct) = (split /;\s*/, request->content_type, 2);
        if ($ct ne 'application/json') {
            pa
  my @requests = unjson(request->body);
        if (!exists($requests[0]->{jsonrpc}) or $requests[0]->{jsonrpc} ne "2.0") {
            pass();
        }

        debug("[handle_jsonrpc_request] Proce
Dancer-Plugin-RPC ( A/AB/ABELTJE/Dancer-Plugin-RPC-1.11.tar.gz, ABELTJE, 2023; MetaCPAN )
Dancer-Plugin-RPC/lib/Dancer/Plugin/RPC/RESTRPC.pm ( view source; MetaCPAN )
ub {
        my ($ct) = (split /;\s*/, request->content_type, 2);
        if ($ct ne 'application/json') {
            pass();
        }
        debug("[handle_restrpc_request] Processing: ", request-
 pass();
        }

        content_type 'application/json';
        my $response;
        my $method_args = request->body
            ? from_json(request->body)
            : undef;

        debug("[
nse } if !ref($response);
        my $jsonise_options = {canonical => 1};
        if (config->{encoding} && config->{encoding} =~ m{^utf-?8$}i) {
            $jsonise_options->{utf8} = 1;
        }
  
Dancer-Plugin-RPC ( A/AB/ABELTJE/Dancer-Plugin-RPC-1.11.tar.gz, ABELTJE, 2023; MetaCPAN )
Dancer-Plugin-RPC/lib/Dancer/RPCPlugin/DispatchItem.pm ( view source; MetaCPAN )
=head1 SYNOPSIS

    use Dancer::RPCPlugin::DispatchItem;
    use Dancer::Plugin::RPC::JSONRPC;
    jsonrpc '/json' => {
        publish => sub {
            return {
                'system.ping' => 

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