dev-master
9999999-devProste SDK - easy SDK for any RESTful API.
MIT
The Requires
- php >=5.5.9
- guzzlehttp/guzzle ^6.1@dev
api rest sdk restful
Proste SDK - easy SDK for any RESTful API.
Easy SDK for any RESTful API, (*2)
To install simply run, (*3)
$ composer require andrewtweber/proste-sdk
Proste is an abstract class. In most cases you simply need to extend it, give it a name, and specify the base URL, (*4)
class GitHub extends SDK { public string $name = 'GitHub'; public string $base_url = 'https://api.github.com/'; }
All requests will throw an Exception if the HTTP status code returned is not 2**, (*5)
The responses returned are expected to be JSON and are decoded into an array., (*6)
$github = new \Proste\GitHub(); try { $releases = $github->get('repos/andrewtweber/proste-sdk/releases'); dd($releases); $github->post('repos/andrewtweber/proste-sdk/issues', [ 'title' => 'New Issue', 'body' => 'Your project is terrible', ]); } catch (\Proste\Exceptions\HttpException $e) { }
Proste SDK - easy SDK for any RESTful API.
MIT
api rest sdk restful