imemento / http
iMemento HTTP Helpers
Installs: 2 380
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
- fideloper/proxy: ^4.2
- guzzlehttp/guzzle: ^7.0
- illuminate/http: ^8.0
- imemento/jwt: ~8.1.0
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-10-26 20:38:00 UTC
README
Abstracts the communication between API and clients. It is framework independent.
Install
composer require imemento/http
Usage
Service.php is an abstract class extended by all the other SDKs and exposes useful REST methods. It manages service and user permissions behind the scenes.
use iMemento\Http\Service; // Example: class DestinationsService extends Service { public function getDestinations() { return $this->_get('/destinations'); } } $config = [ 'service_id' => 'destinations', 'endpoint' => 'http://api-destinations.dev/api/v1/', 'host' => 'api-destinations.dev', ]; $destinations = new DestinationsService(Issuer $issuer, array $config); $destinations->getDestinations(); //returns an array of top destinations