Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codenix-sv/api-client
PHP API client
https://github.com/codenix-sv/api-client
api api-client api-client-php php psr-18 psr-7 simple-api simple-api-client
Last synced: 25 days ago
JSON representation
PHP API client
- Host: GitHub
- URL: https://github.com/codenix-sv/api-client
- Owner: codenix-sv
- License: mit
- Created: 2020-03-18T18:36:20.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-18T18:45:15.000Z (almost 5 years ago)
- Last Synced: 2024-10-14T22:14:15.751Z (2 months ago)
- Topics: api, api-client, api-client-php, php, psr-18, psr-7, simple-api, simple-api-client
- Language: PHP
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP API Client
[![Build Status](https://travis-ci.org/codenix-sv/api-client.svg?branch=master)](https://travis-ci.org/codenix-sv/api-client)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/codenix-sv/api-client/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/codenix-sv/api-client/?branch=master)
[![Test Coverage](https://api.codeclimate.com/v1/badges/b494f68f06e75d45fc68/test_coverage)](https://codeclimate.com/github/codenix-sv/api-client/test_coverage)
[![Maintainability](https://api.codeclimate.com/v1/badges/b494f68f06e75d45fc68/maintainability)](https://codeclimate.com/github/codenix-sv/api-client/maintainability)
[![License: MIT](https://img.shields.io/github/license/codenix-sv/api-client)](https://github.com/codenix-sv/api-client/blob/master/LICENSE)A simple API client, written with PHP that's easy to use.
## Requirements
* PHP >= 7.2
* A [HTTP client](https://packagist.org/providers/php-http/client-implementation)
* A [PSR-7 implementation](https://packagist.org/providers/psr/http-message-implementation)## Installation
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```bash
$ composer require codenix-sv/api-client
```
or add```json
"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:
```bash
$ composer require php-http/curl-client nyholm/psr7
```## Examples
*Send GET request*
```php
use Codenixsv\ApiClient\BaseClient;$client = new BaseClient();
$response = $client->get('https://httpbin.org/get');
```*Send POST request*
```php
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](./LICENSE) for details.