Simplify get example

This commit is contained in:
Zach Borboa
2016-08-07 15:29:21 -07:00
parent 3c48f89d7c
commit cd19c3bd2d
2 changed files with 20 additions and 5 deletions
+8 -5
View File
@@ -4,9 +4,12 @@ require __DIR__ . '/vendor/autoload.php';
use \Curl\Curl;
$curl = new Curl();
for ($i = 1; $i <= 10; $i++) {
$curl->get('https://httpbin.org/get', array(
'page' => $i,
));
// TODO: Do something with result $curl->response.
$curl->get('https://httpbin.org/get');
if ($curl->error) {
echo 'Error: ' . $curl->errorCode . ': ' . $curl->errorMessage;
}
else {
echo 'Response:' . "\n";
var_dump($curl->response);
}
+12
View File
@@ -0,0 +1,12 @@
<?php
require __DIR__ . '/vendor/autoload.php';
use \Curl\Curl;
$curl = new Curl();
for ($i = 1; $i <= 10; $i++) {
$curl->get('https://httpbin.org/get', array(
'page' => $i,
));
// TODO: Do something with result $curl->response.
}