weblabnl / restclient
Installs: 10 311
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- weblabnl/curl: ~1.0
Requires (Dev)
- codedungeon/phpunit-result-printer: ^0.14.0
- mockery/mockery: ^1.0
- phpunit/phpunit: ~6.0
This package is not auto-updated.
Last update: 2024-12-30 17:36:20 UTC
README
This library will help you implement REST APIs faster. Just add an adapter that implements the interface, set the base URL and you are good to go. It's shipped with an OAuth adapter.
Installation
Install using composer:
composer require weblabnl/restclient
Using the Library
Setup client
$api = new \Weblab\RESTClient\RESTClient(); $adapter = (new \Weblab\RESTClient\Adapters\OAuth) ->setAccessToken($accessToken); $api->setAdapter($adapter); $api->setBaseURL('https://api.weblab.nl');
Make a POST request to a REST API
$result = $api->post('/users', ['first_name' => 'Ankie', 'last_name' => 'Visser']);