mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-18 20:02:53 +00:00
19 lines
397 B
PHP
19 lines
397 B
PHP
<?php
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use Curl\Curl;
|
|
|
|
// curl --get --request OPTIONS "http://127.0.0.1:8000/" --data "foo=bar"
|
|
|
|
$curl = new Curl();
|
|
$curl->options('http://127.0.0.1:8000/', [
|
|
'foo' => 'bar',
|
|
]);
|
|
|
|
if ($curl->error) {
|
|
echo 'Error: ' . $curl->errorCode . ': ' . $curl->errorMessage . "\n";
|
|
} else {
|
|
echo 'Response:' . "\n";
|
|
var_dump($curl->response);
|
|
}
|