Skip to content

Commit

Permalink
Add example
Browse files Browse the repository at this point in the history
  • Loading branch information
KhristenkoYura committed May 4, 2015
1 parent 246f2f8 commit 9995aa1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ $client->setOptions([CURLOPT_MAX_RECV_SPEED_LARGE => (10 * 1024 ^ 3) / 123]);
```php
echo $client->get('http://example.com');
```
### Check error
```php
$result = $client->get('http://example.com');
echo (!$result->hasError() ? 'Ok: ' . $result : 'Error: ' .$result->error . ' ('.$result->errorCode.')'), PHP_EOL;
```
### Add curl options in request
```php
echo $client->get('http://example.com', [CURLOPT_REFERER => 'http://example.net/']);
Expand Down

0 comments on commit 9995aa1

Please sign in to comment.