mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-01 21:27:06 +00:00
Add getUrl() example usage to README
This commit is contained in:
@@ -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";
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user