stil/curl-easy — pull request #7 by SalehObaid (2013-10-03 10:01:25+00:00)
Title: Add getHeaders()

i needed to have access to the HEADERS returned by request , so i created this small function.

Example:

```php
include "vendor/autoload.php";

$queue = new \cURL\RequestsQueue;

$queue->getDefaultOptions()
->set(CURLOPT_TIMEOUT, 15)
->set(CURLOPT_HEADER, 1) // <--------- IMPORTANT, you MUST SET THIS
->set(CURLOPT_RETURNTRANSFER, true);

$queue->addListener('complete', function (\cURL\Event $event) {
$response = $event->response;
print_r($response->getHeaders()); // <------- Headers
echo "\n==============\n";
echo $response->getContent(); // <------- Content
});

$request = new \cURL\Request('http://192.168.1.1/test.php?sleep=2');
$queue->attach($request);

// Execute queue$queue->send();
```

results:

```php
Array
(
[Date] => Thu, 03 Oct 2013 09:40:51 GMT
[Server] => Apache
[Content-Length] => 26
[Connection] => close
[Content-Type] => text/html; charset=UTF-8
)
==============
....
```

you must set CURLOPT_HEADER & CURLOPT_RETURNTRANSFER, i think that it will be better if easy-curl do it automatically when there is a call for "getHeaders" but i don't know how to do this.