@@ -25,12 +25,11 @@ The recommended way to install library is [through composer](http://getcomposer.
2525### GET request:
2626
2727``` php
28- include_once('dHttp/Client.php');
29- include_once('dHttp/Response.php');
28+ required __DIR__ . '/vendor/autoload.php';
3029
31- $http = new dHttp\Client('http://website.com');
30+ $client = new dHttp\Client('http://website.com');
3231
33- $resp = $http ->get();
32+ $resp = $client ->get();
3433// Get response code
3534var_dump($resp->getCode());
3635// Get response body
@@ -46,12 +45,10 @@ var_dump($resp->getHeader('Content-Type'));
4645### POST request:
4746
4847``` php
49- include_once('dHttp/Client.php');
50- include_once('dHttp/Response.php');
48+ required __DIR__ . '/vendor/autoload.php';
5149
52- $http = new dHttp\Client('http://website.com');
53-
54- $http->addOptions(array(CURLOPT_RETURNTRANSFER => false))
50+ $client = new dHttp\Client('http://website.com');
51+ $client->addOptions(array(CURLOPT_RETURNTRANSFER => false))
5552 ->setCookie('/tmp/cookie.txt')
5653 ->setUserAgent('Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31')
5754 ->post(array(
@@ -63,13 +60,11 @@ $http->addOptions(array(CURLOPT_RETURNTRANSFER => false))
6360### Multithreaded query:
6461
6562``` php
66- include_once('dHttp/Client.php');
67- include_once('dHttp/Response.php');
63+ required __DIR__ . '/vendor/autoload.php';
6864
69- $multi = new dHttp\Client();
70- $response_array = $multi ->multi(array(
65+ $client = new dHttp\Client();
66+ $response_array = $client ->multi(array(
7167 new dHttp\Client('http://website1.com'),
72-
7368 new dHttp\Client('http://website2.com', array(
7469 CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1',
7570 CURLOPT_TIMEOUT => 5,
0 commit comments