eggbe/client-bridge

Client part of the client-server communications library.

dev-master 2019-02-23 16:22 UTC

This package is auto-updated.

Last update: 2024-11-28 14:43:59 UTC


README

This is the client part of the lightweight and high-performance library that implements client-to-server and server-to-server communications.

Requirements

Install

Here's a pretty simple way to start using Eggbe/ClientBridge:

Step 1: Use Composer to add Eggbe/ClientBridge in your project:

composer require eggbe/client-bridge

Step 2: Create and configure an instance anywhere in your code:

$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.

Usage

You have to use the following method to create request with custom parameters and send it:

$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:

$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!

License

This package is released under the MIT license.