package JSON::RPC::Client::Any;
use strict;
use warnings;
our $VERSION = 1.28;
our @ISA;
BEGIN {
if ( eval { require JSON::RPC::Legacy::Client } ) {
push @ISA, 'JSON::RPC::Legacy::Clie
( eval { require JSON::RPC::Client } ) {
push @ISA, 'JSON::RPC::Client';
}
else {
die "Unable to find JSON RPC Client implementation";
}
};
=head1 NAME
JSON::RPC::Client::An
-- wrap in an available JSON RPC Client implementation
=head1 SYNOPSIS
use JSON::RPC::Client::Any;
my $c = JSON::RPC::Client::Any->new()
...
=head1 DESCRIPTION
B<JSON::RPC::Client::Any> is a
tion via SOAP. Dies on any error or SOAP
FAULT.
=item send_changes_json($message)
Helper method sending commit information via JSON-RPC. Dies on errors.
=back
=cut
require v5.10.0;
use base 'Clas
}
sub relay_message {
my ( $self, $client, $message, $opts ) = @_;
$self->send_changes_json( $client->repo_id,
{ method => 'relay_message', params => [$message, $opts] } );
}
sub s
);
}
}
sub send_changes_json {
my ( $self, $repo_id, $message ) = @_;
require JSON;
require JSON::RPC::Client;
my $rpc = JSON::RPC::Client->new();
$rpc->ua->timeo
PI -- KGB bot API documentation
=head1 VERSION 4 (JSON)
=head2 General, authentication
Version 4 uses JSON-RPC as described in
L<http://http://json-rpc.org/wiki/specification> with one extension. S
t-name
=item request-text
This is the JSON-encoded request text. The same that is sent in the HTTP body.
=back
=head2 Commit notification
Request is a JSON-RPC call to a method called B<commit_v4
akeashorterlink makealongerlink);
our $VERSION = '0.1';
use Carp;
use JSON::RPC::Client;
our $RPC_URL = 'http://deb.li/rpc/json';
=head1 Functions
=over
=item B<makeashorterlink>(I<URL>)
The fun
akeashorterlink {
my $url = shift or croak 'No URL passed to makeashorterlink';
my $rpc = JSON::RPC::Client->new();
my $res
= $rpc->call( $RPC_URL => { method => 'add_url', params
or croak 'No key / URL passed to makealongerlink';
$key =~ s,^http://deb.li/,,;
my $rpc = JSON::RPC::Client->new();
my $res
= $rpc->call( $RPC_URL => { method => 'get_url', params
tocol
=head1 DESCRIPTION
The protocol used by the KGB colaboration service is based on JSON-RPC
(L<http://json-rpc.org/>).
KGB service helps collaboration by relaying notifications about commits in
n a SHA1 hash (in
hexadecimal notation) calculated over the shared secret, the project ID and the
JSON-encoded message.
Upon receiving the HTTP request the server calculates the hash using the
suppli
and problems with the JSON data use HTTP code C<400>.
The error text is in the reason phrase of the HTTP status line (see RFC 2616,
section 6.1).
=head3 Errors reported on JSON-RPC level
After succ