mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-21 23:20:54 +00:00
acf8e9f6a0
Before:
Timeout was reached: Operation timed out after 30001 milliseconds with 1453867 out of 3000000 bytes received
After:
Timeout was reached (CURLE_OPERATION_TIMEOUTED): Operation timed out after 30001 milliseconds with 1453867 out of 3000000 bytes received
19 lines
354 B
PHP
19 lines
354 B
PHP
<?php
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use Curl\Curl;
|
|
|
|
// curl --request GET "https://httpbin.org/get?key=value"
|
|
|
|
$curl = new Curl();
|
|
$curl->get('https://httpbin.org/get', [
|
|
'key' => 'value',
|
|
]);
|
|
|
|
if ($curl->error) {
|
|
echo 'Error: ' . $curl->errorMessage . "\n";
|
|
} else {
|
|
echo 'Response:' . "\n";
|
|
var_dump($curl->response);
|
|
}
|