json-rpc client base on http

Overview

laravel JSON-RPC客户端(Http协议)

本项目是基于JSON-RPC的服务端端实现的rpc客户端
server端见:https://sajya.github.io/


初始化

1.发布

php artisan vendor:publish --provider="Ze\JsonRPCClient\RPCClientProvider"

2.修改config/rpc.php中的配置,可参照vendor/ze/laravel-jsonrpc-client/config/rpc.php

3.封装了两个中间件供服务端路由调用,可参照下面的例子

// rpc.id 为ip白名单验证,支持*放行所有ip
// rpc.auth 为验签中间件,必须使用
Route::rpc('/v1/rpc', [\App\Http\Procedures\TestProcedure::class])
    ->middleware(['rpc.ip','rpc.auth']);

示例

// *需先启动服务

// 注册rpc客户端
$rpc = \RPC::connect('example')->path('api/v1/endpoint');

// 单条请求
$rpc->request('DataSourceProcedure@handle',['name'=>'test']);

// 批量请求
$rpc->batchRequest([
    [
        'id'     =>  1,
        'method' => 'DataSourceProcedure@handle',
        'params' => ['name'=>'test'],
    ]   
]);
You might also like...
oursms.app client library that allows you to send SMS

Oursms laravel client https://oursms.app client library that allows you to send SMS Installation Install oursms client with composer composer requir

Xendit REST API Client for PHP - Card, Virtual Account, Invoice, Disbursement, Recurring Payments, Payout, EWallet, Balance, Retail Outlets Services

Xendit REST API Client for PHP - Card, Virtual Account, Invoice, Disbursement, Recurring Payments, Payout, EWallet, Balance, Retail Outlets Services

PHP client for Kafka

A library to allow people to communicate to Kafka using plain PHP, compatible with Kafka v0.11+ (due to the way the protocol works).

DigitalOcean API v2 client for Symfony and API Platform

DigitalOcean Bundle for Symfony and API Platform DunglasDigitalOceanBundle allows using the DigitalOcean API from your Symfony and API Platform projec

php 8 client for the lemon.markets api

lemon.markets php client This repository contains a php 8+ compatible client for the https://lemon.markets API. The documentation of the API can be fo

PHP client for Microsoft Azure Face API.

Microsoft Azure Face API PHP client A PHP library that utilizes Azure Face REST API. Requirements PHP = 7.4 Installation composer require darmen/php-

Google PHP API Client Services

Google PHP API Client Services

AltiriaSmsPhpClient, the official PHP client of Altiria
AltiriaSmsPhpClient, the official PHP client of Altiria

Altiria, cliente SMS PHP Altiria SMS PHP es un cliente que simplifica al máximo la integración de nuestro API para PHP. Por el momento, esta librería

A2Reviews Client API lets you build apps, extensions or plugins to get reviews from the A2reviews APP
A2Reviews Client API lets you build apps, extensions or plugins to get reviews from the A2reviews APP

A2Reviews Client API lets you build apps, extensions or plugins to get reviews from the A2reviews APP. Including adding reviews to a store's products. It is used to import and export reviews through the API. This is the official package built and developed by A2Reviews, Inc.

Owner
null
PHP JSON-RPC 2.0 Server/Client Implementation with Automatic Client Class Generation via SMD

PHP JSON-RPC 2.0 Server/Client Implementation with Automatic Client Class Generation via SMD

Sergey Bykov 63 Feb 14, 2022
⚡️ Web3 PHP is a supercharged PHP API client that allows you to interact with a generic Ethereum RPC.

Web3 PHP is a supercharged PHP API client that allows you to interact with a generic Ethereum RPC. This project is a work-in-progress. Code and docume

Web3 PHP 665 Dec 23, 2022
SendGrid's PHP HTTP Client for calling APIs

Quickly and easily access any RESTful or RESTful-like API. If you are looking for the SendGrid API client library, please see this repo. Announcements

Twilio SendGrid 119 Nov 25, 2022
HTTP Requestor: Package for a client request that supports you to make an external service request easily and with fast usage.

HttpRequestor from Patienceman HTTP Requestor: Package for a client request that supports you to make an external service request easily and with fast

Manirabona Patience 2 Aug 26, 2022
Use rmccue/requests as a PSR-18 HTTP client

WordPress/Requests PSR-18 Adapter Use WordPress/Requests as a PSR-18 HTTP client adapter. Requires PHP 7.1+ Why? Requests is a HTTP library written in

Artur Weigandt 5 Dec 15, 2022
Google-api-php-client - A PHP client library for accessing Google APIs

Google APIs Client Library for PHP Reference Docs https://googleapis.github.io/google-api-php-client/main/ License Apache 2.0 The Google API Client Li

Google APIs 8.4k Dec 30, 2022
OpenAI API Client is a component-oriented, extensible client library for the OpenAI API. It's designed to be faster and more memory efficient than traditional PHP libraries.

OpenAI API Client in PHP (community-maintained) This library is a component-oriented, extensible client library for the OpenAI API. It's designed to b

Mounir R'Quiba 6 Jun 14, 2023
🍁 Its a HoiChoi Platforn API It Will get All data in json with Streamable Links

✯ Ho!Cho! API ✯ Its a Hoichoi Platforn API It Will get All data in json with Streamable Links ?? Start This Repositry Befor Copying ?? ?? This is Just

Avishkar Patil 14 Dec 22, 2022
A simple PHP GitHub API client, Object Oriented, tested and documented.

PHP GitHub API A simple Object Oriented wrapper for GitHub API, written with PHP. Uses GitHub API v3 & supports GitHub API v4. The object API (v3) is

KNP Labs 2k Jan 7, 2023
A simple Object Oriented PHP Client for Termii SMS API

Termii Client A simple Object Oriented PHP Client for Termii SMS API. Uses Termii API. Requirements PHP >= 7.2 Guzzlehttp ~6|~7 Installation Via Compo

Ilesanmi Olawale Adedotun 5 Feb 24, 2022