2017 © Pedro Peláez
 

project proste-sdk

Proste SDK - easy SDK for any RESTful API.

image

andrewtweber/proste-sdk

Proste SDK - easy SDK for any RESTful API.

  • Thursday, January 14, 2016
  • by andrewtweber
  • Repository
  • 1 Watchers
  • 1 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

proste-sdk

CircleCI, (*1)

Easy SDK for any RESTful API, (*2)

To install simply run, (*3)

$ composer require andrewtweber/proste-sdk

Extending

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/';
}

Usage

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) {
}

Todo

  • Make options available on all requests
  • Basic authorization trait
  • Tests

The Versions

14/01 2016

dev-master

9999999-dev

Proste SDK - easy SDK for any RESTful API.

  Sources   Download

MIT

The Requires

 

api rest sdk restful