Skip to content

Commit 5c714c7

Browse files
committed
Use discovery for tutorial
1 parent af0befb commit 5c714c7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/tutorial.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ TODO: create client instance with discovery and do some requests
3737
When using an asynchronous client, it will use a PSR-7 `RequestInterface` and returns a `Http\Client\Promise` :
3838

3939
```php
40-
$httpAsyncClient = new HttpAsyncClientImplementation();
40+
use Http\Discovery\HttpAsyncClientDiscovery;
41+
42+
$httpAsyncClient = HttpAsyncClientDiscovery::find();
4143
$promise = $httpAsyncClient->sendAsyncRequest($request);
4244
```
4345

@@ -112,7 +114,9 @@ This promise allows you to :
112114
Here is a full example of a classic usage when using the `sendAsyncRequest` method:
113115

114116
```php
115-
$httpAsyncClient = new HttpAsyncClientImplementation();
117+
use Http\Discovery\HttpAsyncClientDiscovery;
118+
119+
$httpAsyncClient = HttpAsyncClientDiscovery::find();
116120

117121
$promise = $httpAsyncClient->sendAsyncRequest($request);
118122
$promise->then(function (ResponseInterface $response) {

0 commit comments

Comments
 (0)