Introduction
This is the client part of the lightweight and high-performance library that implements client-to-server and server-to-server communications., (*1)
Requirements
Install
Here's a pretty simple way to start using Eggbe/ClientBridge:, (*2)
Step 1: Use Composer to add Eggbe/ClientBridge in your project:, (*3)
composer require eggbe/client-bridge
Step 2: Create and configure an instance anywhere in your code:, (*4)
$Bridge = new \Eggbe\ClientBridge\Bridge([
'url' => 'server-url',
'method' => \Eggbe\ClientBridge\Bridge::RM_POST,
]);
The method
option be be one of two possible values: Get or Post. By default it set in Get. Other request methods currently are not allowed here., (*5)
Usage
You have to use the following method to create request with custom parameters and send it:, (*6)
$Bridge->with('custom-parameter-name', 'custom-parameter-value')->send();
Also you could use a more smart syntax if you like it. The following code is identical to the previous:, (*7)
$Bridge->withCustomParameterName('custom-parameter-value')->send();
Unfortunately in now this library is only support the HTTP/HTTPS protocols but we have plans to extend this part of the functionality. We will keep you in touch!, (*8)
License
This package is released under the MIT license., (*9)