mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 20:20:53 +00:00
Add example showing Curl::diagnose() usage
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
// keywords: diagnose, troubleshoot, help
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use Curl\Curl;
|
||||
|
||||
$curl = new Curl();
|
||||
$curl->get('https://httpbin.org/status/400');
|
||||
|
||||
if ($curl->error) {
|
||||
echo 'An error occurred:' . "\n";
|
||||
$curl->diagnose();
|
||||
} else {
|
||||
echo 'Response:' . "\n";
|
||||
var_dump($curl->response);
|
||||
}
|
||||
Reference in New Issue
Block a user