Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
<?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();
}