schenke-io/api-client

simple CURL based api client for applications without a SDK

Installs: 11

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/schenke-io/api-client

v0.4.0 2023-08-27 21:47 UTC

This package is auto-updated.

Last update: 2025-09-28 02:15:40 UTC


README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

simple CURL based api client for applications without a SDK

Installation

composer require schenke-io/api-client

Usage

Build a local class which extends BaseClient or BaseJsonClient.

#app/MyClass.php 

class MyClass extends BaseClient {

    public function getAuthHeader(): array
    {
        return [
            'Authorization: Bearer <YOUR-TOKEN>'
        ];
    }
}

Then use this class like this:

#app/MyClass.php 

$api = new MyClass('https://example.com/api/v2/');
$result = $api->get('/users');
print_r($result);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

The MIT License (MIT). Please see License File for more information.