WARNING: THIS IS NOT PRODUCTION READY
Async Curl library for ReactPHP. This library uses the curl binary of the system.
HttpClient and BuzzBrowser are not capable of handling cookies and/or large file uploads.
composer require choval/reactphp-curl-proc:dev-master
use choval\React\Curl;
use choval\React\CurlResponse;
$loop = React\EventLoop\Factory::create();
$curl = new Curl($loop);
$curl->get('http://google.com/')
->then(function(CurlResponse $resp) {
echo $resp->getBody();
})
->otherwise(function(Exception $e) {
echo 'ERROR: '.$e->getMessage().PHP_EOL;
});