Download the PHP package staskjs/simple-api without Composer
On this page you can find all versions of the php package staskjs/simple-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download staskjs/simple-api
More information about staskjs/simple-api
Files in staskjs/simple-api
Download staskjs/simple-api
More information about staskjs/simple-api
Files in staskjs/simple-api
Vendor staskjs
Package simple-api
Short Description Library for creating simple api wrappers for php
License
Package simple-api
Short Description Library for creating simple api wrappers for php
License
Please rate this library. Is it a good library?
Informations about the package simple-api
Simple API
Installation
composer require staskjs/simple-api
Usage
Create class for your api wrapper.
use Staskjs\SimpleApi\SimpleJsonApi;
class GithubApi extends SimpleJsonApi {
// Headers for each request
protected $headers = [
'Authorization' => 'token TOKEN',
];
// Specify default query params for each request (for example this can be api version or api token)
protected $default_query = [
];
public function getUsers() {
return $this->request('GET', 'users');
}
}
// ...
$api = new GithubApi('https://api.github.com');
$success = $api->getUsers();
// If http query was successful
if ($success) {
$data = $api->getData();
}
else {
$errors = $api->getErrors();
}
All versions of simple-api with dependencies
PHP Build Version
Package Version
Requires
guzzlehttp/guzzle Version
^6.2
The package staskjs/simple-api contains the following files
Loading the files please wait ....