@@ -12,25 +12,24 @@ To install the cURL client, run:
12
12
13
13
$ composer require php-http/curl-client
14
14
15
- Usage
16
- -----
17
-
18
- The cURL client needs a :ref: `message <message-factory >` and a :ref: `stream <stream-factory >`
19
- factory in order to to work::
15
+ .. include :: includes/install-message-factory.inc
20
16
21
- use Http\Client\Curl\Client;
17
+ .. include :: includes/install-discovery.inc
22
18
23
- $client = new Client($messageFactory, $streamFactory);
19
+ Usage
20
+ -----
24
21
25
- Using `php-http/message <https://packagist.org/packages/php-http/message >`_::
22
+ The cURL client needs a :ref: `message factory <message-factory >` and a
23
+ :ref: `stream factory <stream-factory >` in order to to work. You can either specify the factory
24
+ explicitly::
26
25
27
26
use Http\Client\Curl\Client;
28
27
use Http\Message\MessageFactory\DiactorosMessageFactory;
29
28
use Http\Message\StreamFactory\DiactorosStreamFactory;
30
29
31
30
$client = new Client(new DiactorosMessageFactory(), new DiactorosStreamFactory());
32
31
33
- Using ` php-http/discovery < https://packagist.org/packages/php-http/ discovery>`_ ::
32
+ Or you can use :doc: ` ../ discovery` ::
34
33
35
34
use Http\Client\Curl\Client;
36
35
use Http\Discovery\MessageFactoryDiscovery;
@@ -53,7 +52,8 @@ You can use `cURL options <http://php.net/curl_setopt>`_ to configure Client::
53
52
];
54
53
$client = new Client(MessageFactoryDiscovery::find(), StreamFactoryDiscovery::find(), $options);
55
54
56
- These options cannot be used (will be overwritten by Client):
55
+ The following options can not be changed in the set up. Most of them are to be provided with the
56
+ request instead:
57
57
58
58
* CURLOPT_CUSTOMREQUEST
59
59
* CURLOPT_FOLLOWLOCATION
0 commit comments