diff --git a/examples/get.php b/examples/get.php index 2e41f87..f545059 100644 --- a/examples/get.php +++ b/examples/get.php @@ -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); } diff --git a/examples/get_pages.php b/examples/get_pages.php new file mode 100644 index 0000000..2e41f87 --- /dev/null +++ b/examples/get_pages.php @@ -0,0 +1,12 @@ +get('https://httpbin.org/get', array( + 'page' => $i, + )); + // TODO: Do something with result $curl->response. +}