Add getUrl() example usage to README

This commit is contained in:
Zach Borboa
2014-09-03 23:31:28 -07:00
parent 896eb5ebdf
commit bd73cbc113
+4 -2
View File
@@ -120,11 +120,13 @@ $curl = new Curl();
$curl->setOpt(CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1');
$curl->success(function($instance) {
echo 'call was successful. response was' . "\n";
$url = $instance->getUrl();
echo 'call to "' . $url . '" was successful. response was' . "\n";
echo $instance->response . "\n";
});
$curl->error(function($instance) {
echo 'call was unsuccessful.' . "\n";
$url = $instance->getUrl();
echo 'call to "' . $url . '" was unsuccessful.' . "\n";
echo 'error code:' . $instance->error_code . "\n";
echo 'error message:' . $instance->error_message . "\n";
});