Skip to content

codenix-sv/api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP API Client

Build Status Scrutinizer Code Quality Test Coverage Maintainability License: MIT

A simple API client, written with PHP that's easy to use.

Requirements

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require codenix-sv/api-client

or add

"codenix-sv/api-client": "^1.0"

to the require section of your application's composer.json file.

Make sure you have installed a PSR-18 HTTP Client and PSR-7 message implementation before you install this package. For example:

$ composer require php-http/curl-client nyholm/psr7

Examples

Send GET request

use Codenixsv\ApiClient\BaseClient;

$client = new BaseClient();
$response = $client->get('https://httpbin.org/get');

Send POST request

use Codenixsv\ApiClient\BaseClient;

$client = new BaseClient();
$response = $client->post('https://httpbin.org/post', 'foo=bar');

License

codenix-sv/api-client is released under the MIT License. See the bundled LICENSE for details.