2017 © Pedro Peláez
 

library light-rpc

LightRPC is a Clean, Easy and Simple, JSON-RPC client over HTTPS for PHP.

image

hernandev/light-rpc

LightRPC is a Clean, Easy and Simple, JSON-RPC client over HTTPS for PHP.

  • Tuesday, April 10, 2018
  • by hernandev
  • Repository
  • 1 Watchers
  • 2 Stars
  • 67 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 26 % Grown

The README.md

LightRPC

Build Status Codecov Latest Stable Version License, (*1)

LightRPC: An easy, simple and effective JSON-RPC 2 client for PHP., (*2)

This client was designed inspired by the Javascript project LightRPC.

1. Background.

This project main objective is to communicate with STEEM blockchain JSON-RPC servers. It was made simple enough to fit any JSON-RPC 2 service but default values are intended to make it easy on STEEM., (*3)

2. Install:

Dead simple:, (*4)

composer require hernandev/light-rpc

3. Usage:

Dead simple, chose one:, (*5)

3.1. Direct calls:


// alias. use LightRPC\Client; // start a client instance. $client = new Client('https://api.steemit.com'); // call it. $response = $client->call('follow_api', 'get_follow_count', ['hernandev']);

3.2. Request instances.


// alias. use LightRPC\Client; use LightRPC\Request; // start a client instance. $client = new Client('https://api.steemit.com'); // create a request instance. $request = new Request('follow_api', 'get_follow_count', ['hernandev']); // send it. $response = $client->send($request);

3.3. Handling responses:

Dead simple, chose one:, (*6)


// wanna check for errors? $response->isError(); // use the magic result getters. $response->account; // 'hernandev' $response->follower_count; // 123 $response->following_count; // 123 // OR // use a get method: $response->get('account'); // 'hernandev' $response->get('follower_count'); // 123 $response->get('following_count'); // 123 // OR // get all result OR error data: $response->data(); // [ 'account' => 'hernandev', 'following_count' => 123, 'follower_count' => 123] $response->get(); // [ 'account' => 'hernandev', 'following_count' => 123, 'follower_count' => 123] // OR // If you are a boring person, just get the full response as array. $response->toArray(); // [ 'jsonrpc' => '2.0', 'id' => 0, 'result' => ['foo' => 'bar']] // You are really boring you know, wanna as JSON string? (string) $response; // '{"jsonrpc":"2.0","id":0,"result":{...}}

The Versions

10/04 2018

dev-develop

dev-develop

LightRPC is a Clean, Easy and Simple, JSON-RPC client over HTTPS for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Diego Hernandes

10/04 2018

dev-master

9999999-dev

LightRPC is a Clean, Easy and Simple, JSON-RPC client over HTTPS for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Diego Hernandes

10/04 2018

1.0.2

1.0.2.0

LightRPC is a Clean, Easy and Simple, JSON-RPC client over HTTPS for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Diego Hernandes

14/03 2018

1.0.1

1.0.1.0

LightRPC is a Clean, Easy and Simple, JSON-RPC client over HTTPS for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Diego Hernandes

14/03 2018

1.0.0

1.0.0.0

LightRPC is a Clean, Easy and Simple, JSON-RPC client over HTTPS for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Diego Hernandes