2017 © Pedro Peláez
 

library guzzle-json-rpc

json-rpc server and client base on guzzle,support async

image

xujif/guzzle-json-rpc

json-rpc server and client base on guzzle,support async

  • Thursday, May 4, 2017
  • by xujif
  • Repository
  • 1 Watchers
  • 0 Stars
  • 323 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

json-rpc base on guzzle

a full json-rpc 2.0 RFC implementation, (*1)

Usage

Server

/*
 * in any http framworks
 */
$apiObject = new Api();
$server = new \Xujif\JsonRpc\Server($apiObject);
// return array
// please return to client with json
$ret = $server->handle();
header('Content-Type:application/json')
echo json_encode($ret);

Client

$client = new \Xujif\JsonRpc\Client('API_SERVER_URL');
$client->call('method',[1,2,3]);
// or
$client->method(1,2,3)
// or notification(no result send async)
$client->notify()->method(1,2,3)
// or batch call
$client->batch()->method(1,2,3)->method2(1,2)->exec();
// or batch notification
$client->batch()->notify()->method(1,2,3)->method2(1,2)->exec();
// or batch mixed notification and call
// if all batch call is notify it will send async
$client->batch()
       ->notify()
       ->method(1,2,3)
       ->notify(false)
       ->method2(1,2)
       ->exec();


The Versions

04/05 2017

dev-master

9999999-dev

json-rpc server and client base on guzzle,support async

  Sources   Download

MIT

The Requires

 

by Avatar xujif

guzzle json rpc webservice

04/05 2017

1.0.4

1.0.4.0

json-rpc server and client base on guzzle,support async

  Sources   Download

MIT

The Requires

 

by Avatar xujif

guzzle json rpc webservice

26/04 2017

1.0.3

1.0.3.0

json-rpc server and client base on guzzle,support async

  Sources   Download

MIT

The Requires

 

by Avatar xujif

guzzle json rpc webservice

09/03 2017

1.0.2

1.0.2.0

json-rpc server and client base on guzzle,support async

  Sources   Download

MIT

The Requires

 

by Avatar xujif

guzzle json rpc webservice

09/02 2017

1.0.1

1.0.1.0

json-rpc server and client base on guzzle,support async

  Sources   Download

MIT

The Requires

 

by Avatar xujif

guzzle json rpc webservice