laravel-http-rpc maintained by juwai
Description
Laravel package for http rpc client
Author
Last update
2019/05/08 11:41
(dev-master)
License
Downloads
3 815
laravel-http-rpc
This package provides an easy way of connecting to HTTP RPC.
Installation
-
Add facade and providers to
config/app.php'aliases' => [ ... 'HTTPRPC' => Juwai\LaravelHTTPRPC\Facades\HTTPRPC::class, ],'providers' => [ ... Juwai\LaravelHTTPRPC\Providers\HTTPRPCClientProvider::class, ], -
Publish config file:
$ php artisan vendor:publish -
Add real service configuration to the published config file
config/httprpc.php.
Usage
GET method
$client = HTTPRPC::get('service_one', '1.0');
$response = $client->service_function($param1, $param2);
POST method
$client = HTTPRPC::get('service_one', '1.0', 2000, 'POST');
$response = $client->service_function(['param1' => $param1, 'param2' => $param2]);
Connection monitor
If you installed Debugbar the RPC connection information shows on Debugbar panels.