public function testDebugTo() { $file_name = 'debug.txt'; $curl = new \CurlRox\Curl(); $curl->Uri('http://127.0.0.1:8000/server.php')->setPostPayload(['test' => '1', 'foo' => 'bar'])->postRequest()->debugTo($file_name); $this->assertFileExists($file_name); unlink($file_name); }
<?php require '../vendor/autoload.php'; try { $webCrawler = new \CurlRox\Curl(); $r = $webCrawler->Uri('http://httpbin.org/get')->getRequest()->getHttpResponse(); echo $r; } catch (Exception $e) { echo $e->getMessage(); }