2017 © Pedro Peláez
 

library rest-api-client

An elegant and smart Rest API Client with OAuth2 authentication support. Build for Laravel and Opensmarty Starter.

image

opensmarty/rest-api-client

An elegant and smart Rest API Client with OAuth2 authentication support. Build for Laravel and Opensmarty Starter.

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Opensmarty Rest API Client

Latest Version Software License Total Downloads, (*1)

Opensmarty Starter API Client is an elegant and smart Rest API Client with OAuth2 authentication support., (*2)

Build for Laravel and Opensmarty Starter., (*3)

It can be used for accessing APIs created using Opensmarty Starter framework., (*4)

Install

Via Composer

Install composer package to your laravel project, (*5)

``` bash composer require opensmarty/rest-api-client, (*6)


Add Service Provider to `config/app.php` ``` php 'providers' => [ ... Opensmarty\Rest\RestClientServiceProvider::class, ... ],

Publishing config file., (*7)

``` bash php artisan vendor:publish, (*8)


After published, config file for Rest Client is `config/rest-client.php`, you will need to config it to use Rest Client. ## Usage ``` php $restClient = new \Opensmarty\Rest\RestClient('Opensmarty-starter'); $restClient->setOAuthUserCredentials([ 'username' => 'opensmarty@163.com', 'password' => 'Abc12345', ]); $restClient->withOAuthTokenTypeUser(); $response = $restClient->get("users")->getResponse(); if (!$restClient->isResponseStatusCode(200)) { $restClient->printResponseOriginContent(); $responseMessage = $restClient->getResponseMessage(); print_r($responseMessage); } else { $responseData = $restClient->getResponseData(); print_r($responseData); }

Testing

bash phpunit, (*9)

Contributing

Please see CONTRIBUTING for details., (*10)

Credits

License

The MIT License (MIT). Please see License File for more information., (*11)

The Versions

07/12 2017

dev-master

9999999-dev https://github.com/opensmarty/rest-api-client

An elegant and smart Rest API Client with OAuth2 authentication support. Build for Laravel and Opensmarty Starter.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel api rest client oauth2 opensmarty-starter

07/12 2017

v1.0.1

1.0.1.0 https://github.com/opensmarty/rest-api-client

An elegant and smart Rest API Client with OAuth2 authentication support. Build for Laravel and Opensmarty Starter.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel api rest client oauth2 opensmarty-starter

04/12 2017

v1.0.0

1.0.0.0 https://github.com/opensmarty/rest-api-client

An elegant and smart Rest API Client with OAuth2 authentication support. Build for Laravel and Opensmarty Starter.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel api rest client oauth2 opensmarty-starter