2017 © Pedro Peláez
 

library simpleapi

Simple api wrapper with easy caching and throttling

image

skizu/simpleapi

Simple api wrapper with easy caching and throttling

  • Thursday, July 23, 2015
  • by Skizu
  • Repository
  • 1 Watchers
  • 2 Stars
  • 136 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

SimpleAPI for Laravel 4 and 5

A simple api wrapper with quick and easy caching and throttling., (*1)

Configuration

To configure a new api key you must register it in the .env where in the example EXAMPLE_KEY is the key., (*2)

# Required 
EXAMPLE_KEY_API_URL=http://api.example.com/

# Optional
EXAMPLE_KEY_API_THROTTLE_LIMIT=100
EXAMPLE_KEY_API_STORAGE_TIME=1440
EXAMPLE_KEY_API_CACHE_TIME=60

Usage

Example to resolve http://api.example.com/baz?foo=bar, (*3)

$api = new SimpleAPI\RegisterAPI('example_key');

$query = [
    'foo' => 'bar'
];

$result = $api->action('baz')->lookup($query);

Error handling

This library works by throwing exceptions which you would need to catch., (*4)

  • Invalid configuration ConfigException
  • Throlled API ThrottleException
  • Request error RequestException
  • Response error ResponseException
  • Server error ServerException

The Versions

23/07 2015

dev-master

9999999-dev

Simple api wrapper with easy caching and throttling

  Sources   Download

MIT

The Requires

 

by Avatar Skizu

laravel api php wrapper

23/07 2015

dev-develop

dev-develop

Simple api wrapper with easy caching and throttling

  Sources   Download

MIT

The Requires

 

by Avatar Skizu

laravel api php wrapper