mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 20:20:53 +00:00
Simplify get example
This commit is contained in:
+8
-5
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
Reference in New Issue
Block a user