From 6e063bd0ea4c547e6e946347db98673b1a22a8be Mon Sep 17 00:00:00 2001 From: Daniel Martin Date: Thu, 25 May 2017 16:15:43 +0200 Subject: [PATCH 1/2] doc code example fix --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e1e1ea0..32eaf15 100644 --- a/README.md +++ b/README.md @@ -128,13 +128,13 @@ my_users_api: timeout: 2 requests: list_users: - url: /users + path: /users options: timeout: 15 get_user: - url: /users/${USER_ID} + path: /users/${USER_ID} create_user: - url: /users/${USER_ID} + path: /users/${USER_ID} headers: - Content-Type: application/json method: POST @@ -241,7 +241,7 @@ $client = $builder->build(); #### Building a service client To build a service client specify the name of the service when building the client in the last step of the builder ```php -$myServiceApi = $builder->builder('my_service'); +$myServiceApi = $builder->build('my_service'); ``` #### Customizing the builds From 5896f844e21b8e21317bc169bd4eb7f05916df84 Mon Sep 17 00:00:00 2001 From: Daniel Martin Date: Thu, 25 May 2017 16:47:14 +0200 Subject: [PATCH 2/2] fix on code example --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 32eaf15..6eab51e 100644 --- a/README.md +++ b/README.md @@ -286,10 +286,10 @@ $builder->withConsoleDebug(); ### Creating a request To create a request you need to identify the service and the request that you want. Additionally you can pass dynamic values to substitute placeholders ```php -$request = $client->create('weather', 'forecast', ['city' => $city]); +$request = $client->request('weather', 'forecast', ['city' => $city]); // Service specific clients do not need the service name -$request = $weather->create('forecast', ['city' => $city]); +$request = $weather->request('forecast', ['city' => $city]); ``` The requests created are `Cmp\Http\Message\Request` intances, implementing `Psr\Http\Message\RequestInterface`, making them suitable to share between libraries and frameworks