reactphp/react — pull request #231 by juzna (2013-10-27 18:48:14+00:00)
Title: Add getResponseBody() to http client

Hi guys, I just started playing with react and I love it. Though I miss some methods to make my coding easy and pleasant. I'm not sure if this method is in a good place, but it seems convenient to me. Please give me comments if you have other thoughts, as I don't know react well yet.

---

This methods **returns Promise of the response body**, making http request easier with promises.

Making a http request and reading the response is not very convenient at the moment - you need to attach two handlers: on-response + on-data. This method shall make it easier.

Example of use case:
```php
$httpClient->request('GET', 'http://google.com')->getResponseBody()->then(
function($data) {
echo htmlspecialchars($data);
},
function($err) {
dump($err);
}
);
```