Skip to content

Commit af6af3d

Browse files
committed
Update README.
1 parent 4903c16 commit af6af3d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

README.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@ $ composer require php-http/curl-client
2020

2121
## Usage
2222

23-
### Using [php-http/utils](https://packagist.org/packages/php-http/utils):
23+
### Using [php-http/discovery](https://packagist.org/packages/php-http/discovery):
2424

2525
```php
2626
use Http\Client\Curl\Client;
27-
use Http\Client\Utils\MessageFactory\GuzzleMessageFactory;
28-
use Http\Client\Utils\StreamFactory\GuzzleStreamFactory;
27+
use Http\Discovery\MessageFactoryDiscovery;
28+
use Http\Discovery\StreamFactoryDiscovery;
2929

30-
$messageFactory = new GuzzleMessageFactory();
31-
$client = new Client($messageFactory, new GuzzleStreamFactory());
30+
$messageFactory = MessageFactoryDiscovery::find();
31+
$streamFactory = StreamFactoryDiscovery::find();
32+
$client = new Client($messageFactory, $streamFactory);
3233

3334
$request = $messageFactory->createRequest('GET', 'http://example.com/');
3435
$response = $client->sendRequest($request);
@@ -54,14 +55,14 @@ You can use [cURL options](http://php.net/curl_setopt) to configure Client:
5455

5556
```php
5657
use Http\Client\Curl\Client;
57-
use Http\Client\Utils\MessageFactory\GuzzleMessageFactory;
58-
use Http\Client\Utils\StreamFactory\GuzzleStreamFactory;
58+
use Http\Discovery\MessageFactoryDiscovery;
59+
use Http\Discovery\StreamFactoryDiscovery;
5960

6061
$options = [
6162
CURLOPT_CONNECTTIMEOUT => 10, // The number of seconds to wait while trying to connect.
6263
CURLOPT_SSL_VERIFYPEER => false // Stop cURL from verifying the peer's certificate
6364
];
64-
$client = new Client(new GuzzleMessageFactory(), new GuzzleStreamFactory(), $options);
65+
$client = new Client(MessageFactoryDiscovery::find(), StreamFactoryDiscovery::find(), $options);
6566
```
6667

6768
These options can not ne used:

0 commit comments

Comments
 (0)