mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 12:14:36 +00:00
Add HTTP GET examples with and without using base url
This commit is contained in:
@@ -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.
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
use \Curl\Curl;
|
||||
|
||||
$curl = new Curl('https://httpbin.org/get');
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
$curl->get(array(
|
||||
'page' => $i,
|
||||
));
|
||||
// TODO: Do something with result $curl->response.
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
use \Curl\Curl;
|
||||
|
||||
$curl = new Curl();
|
||||
$curl->setUrl('https://httpbin.org/get');
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
$curl->get(array(
|
||||
'page' => $i,
|
||||
));
|
||||
// TODO: Do something with result $curl->response.
|
||||
}
|
||||
Reference in New Issue
Block a user