CoreNetwork — Beautify CURL By Using PHP Objects

We all know that using CURL in PHP is atrocious. Who wants their beautiful code to look like this:

$c = curl_init($cURL);
curl_setopt($c, CURLOPT_URL, "http://tockx.com/s.php");
curl_setopt($c, CURLOPT_HEADER, 1);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, $strParameters);
$strPage = curl_exec();
curl_close($c);

Plus, it just seems so repetitive. When you a guy like me, and your build a few RESTful applications, its tough to let your code get “uglied” with code that looks out of place — so I wrote CoreNetwork, the best way to use curl with PHP. Using CoreNetwork, you turn your old, dirty curl code into something beautiful:

$net = new CoreNetwork()->url('http://your-rest.com/api/noun');
$get = $net->get()->returned();

Its easy to use and is available at GitHub. Go check it out, it will make php and curl so easy and beautiful.