Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 

README.md

proste-sdk

Easy SDK for any RESTful API

To install simply run

$ 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

class GitHub extends SDK
{
    protected $name = 'GitHub';
 
    protected $base_url = 'https://api.github.com/';
}

Usage

All requests will throw an Exception if the HTTP status code returned is not 2**

The responses returned are expected to be JSON and are decoded into an array.

$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 (\Exception $e) {
}

Todo

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

About

Simple PHP SDK for any RESTful API

Topics

Resources

Releases

No releases published

Packages

No packages published

Languages