claesjac / json-rpc-simple Goto Github PK
View Code? Open in Web Editor NEWA simplistic JSON-RPC wd 1.1 client and dispatcher for Perl
A simplistic JSON-RPC wd 1.1 client and dispatcher for Perl
NAME JSON::RPC::Simple - Simple JSON-RPC client and dispatcher (WD 1.1 subset only currently) SYNOPSIS As client use JSON::RPC::Simple; my $client = JSON::RPC::Simple->connect("https://www.example.com/API/", { timeout => 600, }); my $r = $client->echo({ param1 => "value" }); As server: package MyApp::API; use base qw(JSON::RPC::Simple); sub new { return bless {}, shift }; sub echo : JSONRpcMethod(Arg1, Arg2, Arg3) { my ($self, $request, $args) = @_; } package MyApp::Handler; my $dispatcher = JSON::RPC::Simple->dispatch_to({ "/API" => MyApp::API->new(), "/OtherAPI" => "MyApp::OtherAPI", }); sub handle { my $request = shift; # Assume a HTTP::Request my $response = $dispatcher->handle($request->uri->path, $request); return $response; # Assume a HTTP::Response } DESCRIPTION This module is a very simple JSON-RPC 1.1 WD implementation that only supports a subset of the specification. It supports HTTP POST only Named and positonal arguments Error objects USAGE As a client This module provides a class method for creating a client that works as a shortcut to "JSON::RPC::Simple::Client->new(...)". connect(URL) connect(URL, \%OPTIONS) Returns a new client for the given *URL* with the optional *%OPTIONS*. See "options" in JSON::RPC::Simple::Client for what options it accepts. AUTHOR Claes Jakobsson, <[email protected]> THANKS & CONTRIBUTORS Scott Baker COPYRIGHT AND LICENSE Copyright (C) 2010-2011 by Claes Jakobsson and Glue Finance AB This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
I don't see a way to call a namespaced method like cust.GetInfo() or billing.Invoice(). Is it possible to call a method with a period in the name? Or specify the namespace prior to the call?
In Client.pm line #60 it gets the params from from AUTOLOAD. That only allows you to send a single value (or a reference) to a method call. Thus if I had a method call like:
$obj->echo_data(2,4,6);
Only the 2 will get sent. I believe line #60 should be changed to @params
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.