Add HTTP GET examples with and without using base url

This commit is contained in:
Zach Borboa
2016-07-04 02:46:44 -07:00
parent 2dca55fe5d
commit 9d94a9b8a1
3 changed files with 37 additions and 0 deletions
+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.
}
+12
View File
@@ -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.
}
+13
View File
@@ -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.
}