From 691bd12e4969b8fc1e034b37c693d82ad65e4442 Mon Sep 17 00:00:00 2001 From: Meike Pabst Date: Wed, 28 Jun 2017 11:04:14 +0200 Subject: [PATCH 1/2] Mention per request options in README.md --- README.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c838eb6..079afe1 100644 --- a/README.md +++ b/README.md @@ -46,21 +46,28 @@ $client = new Json([ // 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']] +); ``` - ## Issues/Features proposals [Here](https://github.com/mjacobus/php-json-api-client/issues) is the issue tracker. @@ -89,7 +96,7 @@ Only tested code will be accepted. Please follow fix the style guide. ./vendor/bin/bro-code fix tests ``` -## Lincense +## License This software is distributed under the [MIT](MIT-LICENSE) license. From 7d83f1e1105ba946554b6513474a04ba727971fe Mon Sep 17 00:00:00 2001 From: Meike Pabst Date: Wed, 28 Jun 2017 11:05:21 +0200 Subject: [PATCH 2/2] Fix style --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 079afe1..15548a1 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ $resources = $client->post('/resources', [ // with optionally supplied custom options per-request: $resources = $client->post( '/resources', - ['name' => 'foo',], + ['name' => 'foo'], ['headers' => ['X-Request-Token' => 'e4d909c290d0fb1ca068ffaddf22cbd0']] ); ```