Skip to content

Commit ce99317

Browse files
committed
Move documentation to official site.
1 parent 5e286ad commit ce99317

File tree

1 file changed

+1
-64
lines changed

1 file changed

+1
-64
lines changed

Diff for: README.md

+1-64
Original file line numberDiff line numberDiff line change
@@ -18,72 +18,9 @@ Via Composer
1818
$ composer require php-http/curl-client
1919
```
2020

21-
## Usage
22-
23-
### Using [php-http/message](https://packagist.org/packages/php-http/message):
24-
25-
```php
26-
use Http\Client\Curl\Client;
27-
use Http\Message\MessageFactory\DiactorosMessageFactory;
28-
use Http\Message\StreamFactory\DiactorosStreamFactory;
29-
30-
$messageFactory = new DiactorosMessageFactory();
31-
$client = new Client($messageFactory, new DiactorosStreamFactory());
32-
33-
$request = $messageFactory->createRequest('GET', 'http://example.com/');
34-
$response = $client->sendRequest($request);
35-
```
36-
37-
### Using [php-http/discovery](https://packagist.org/packages/php-http/discovery):
38-
39-
```php
40-
use Http\Client\Curl\Client;
41-
use Http\Discovery\MessageFactoryDiscovery;
42-
use Http\Discovery\StreamFactoryDiscovery;
43-
44-
$messageFactory = MessageFactoryDiscovery::find();
45-
$streamFactory = StreamFactoryDiscovery::find();
46-
$client = new Client($messageFactory, $streamFactory);
47-
48-
$request = $messageFactory->createRequest('GET', 'http://example.com/');
49-
$response = $client->sendRequest($request);
50-
```
51-
52-
### Configuring client
53-
54-
You can use [cURL options](http://php.net/curl_setopt) to configure Client:
55-
56-
```php
57-
use Http\Client\Curl\Client;
58-
use Http\Discovery\MessageFactoryDiscovery;
59-
use Http\Discovery\StreamFactoryDiscovery;
60-
61-
$options = [
62-
CURLOPT_CONNECTTIMEOUT => 10, // The number of seconds to wait while trying to connect.
63-
CURLOPT_SSL_VERIFYPEER => false // Stop cURL from verifying the peer's certificate
64-
];
65-
$client = new Client(MessageFactoryDiscovery::find(), StreamFactoryDiscovery::find(), $options);
66-
```
67-
68-
These options can not be used:
69-
70-
* CURLOPT_CUSTOMREQUEST
71-
* CURLOPT_FOLLOWLOCATION
72-
* CURLOPT_HEADER
73-
* CURLOPT_HTTP_VERSION
74-
* CURLOPT_HTTPHEADER
75-
* CURLOPT_NOBODY
76-
* CURLOPT_POSTFIELDS
77-
* CURLOPT_RETURNTRANSFER
78-
* CURLOPT_URL
79-
80-
These options can be overwritten by Client:
81-
82-
* CURLOPT_USERPWD
83-
8421
## Documentation
8522

86-
Please see the [official documentation](http://php-http.readthedocs.org/en/latest/).
23+
Please see the [official documentation](http://docs.php-http.org/en/latest/clients/curl-client.html).
8724

8825
## Testing
8926

0 commit comments

Comments
 (0)