From 9d94a9b8a10a8af1cc0798ffc2c350532425e158 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Mon, 4 Jul 2016 02:46:44 -0700 Subject: [PATCH] Add HTTP GET examples with and without using base url --- examples/get.php | 12 ++++++++++++ examples/get_base_url_1.php | 12 ++++++++++++ examples/get_base_url_2.php | 13 +++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 examples/get.php create mode 100644 examples/get_base_url_1.php create mode 100644 examples/get_base_url_2.php diff --git a/examples/get.php b/examples/get.php new file mode 100644 index 0000000..2e41f87 --- /dev/null +++ b/examples/get.php @@ -0,0 +1,12 @@ +get('https://httpbin.org/get', array( + 'page' => $i, + )); + // TODO: Do something with result $curl->response. +} diff --git a/examples/get_base_url_1.php b/examples/get_base_url_1.php new file mode 100644 index 0000000..2b51da8 --- /dev/null +++ b/examples/get_base_url_1.php @@ -0,0 +1,12 @@ +get(array( + 'page' => $i, + )); + // TODO: Do something with result $curl->response. +} diff --git a/examples/get_base_url_2.php b/examples/get_base_url_2.php new file mode 100644 index 0000000..58fc376 --- /dev/null +++ b/examples/get_base_url_2.php @@ -0,0 +1,13 @@ +setUrl('https://httpbin.org/get'); +for ($i = 1; $i <= 10; $i++) { + $curl->get(array( + 'page' => $i, + )); + // TODO: Do something with result $curl->response. +}