Simple wrapper for Guzzle.
Code information:
Scrutinizer
Package information:
Append the lib to your requirements key in your composer.json.
composer require brofist/json-api-client
use Brofist\ApiClient\Json;
$client = new Json([
'endpoint' => 'http://foo.bar/v1/blah',
// optional
'basicAuth' => ['username', 'password'],
]);
// basic usage:
$resources = $client->get('/resources', [
'limit' => 100,
]);
$resources = $client->put('/resources/1', [
'name' => 'foo',
]);
$resources = $client->post('/resources', [
'name' => 'foo',
]);
// with optionally supplied custom options per-request:
$resources = $client->post(
'/resources',
['name' => 'foo'],
['headers' => ['X-Request-Token' => 'e4d909c290d0fb1ca068ffaddf22cbd0']]
);
Here is the issue tracker.
Only tested code will be accepted. Please follow fix the style guide.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
./vendor/bin/phpunit
# Fixes code
./vendor/bin/bro-code fix src
./vendor/bin/bro-code fix tests
This software is distributed under the MIT license.