mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-18 15:01:39 +00:00
22 lines
400 B
PHP
22 lines
400 B
PHP
<?php
|
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use Curl\Curl;
|
|
|
|
// curl --request PATCH "https://httpbin.org/patch" --data "a=1&b=2&c=3"
|
|
|
|
$curl = new Curl();
|
|
$curl->patch('https://httpbin.org/patch', [
|
|
'a' => '1',
|
|
'b' => '2',
|
|
'c' => '3',
|
|
]);
|
|
|
|
if ($curl->error) {
|
|
echo 'Error: ' . $curl->errorMessage . "\n";
|
|
} else {
|
|
echo 'Response:' . "\n";
|
|
var_dump($curl->response);
|
|
}
|