MicroBridge-PHP is a lightweight (less than 1000 lines of code) PHP 7.1 tool for issuing intern-API requests.
Install by running:
composer require lfvcodes/MicroBridge-PHPIf you're not using Composer, you can manually integrate MicroBridge into your project by following these steps:
Download or clone the repository and copy the src/ folder into your project:
In your main file (index.php or similar), include the class file and use the namespace:
Using methods with params:
<?php
use MicroBridge\MicroBridge;
$client = new MicroBridge($method = 'POST'); //Can use POST/PUT/PATCH/DELETE
$response = $client->request($urlOrPath,$arrayParams);
print_r($response);
?>Using URL Params with GET:
<?php
use MicroBridge\MicroBridge;
$client = new MicroBridge($method = 'GET');
$response = $client->request('../api/index.php?id=4');
print_r($response);
?>