mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-19 00:41:35 +00:00
22 lines
470 B
PHP
22 lines
470 B
PHP
<?php
|
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use Curl\Curl;
|
|
|
|
// curl --request PUT "https://httpbin.org/put" --data "id=1&first_name=Zach&last_name=Borboa"
|
|
|
|
$curl = new Curl();
|
|
$curl->put('https://httpbin.org/put', [
|
|
'id' => '1',
|
|
'first_name' => 'Zach',
|
|
'last_name' => 'Borboa',
|
|
]);
|
|
|
|
if ($curl->error) {
|
|
echo 'Error: ' . $curl->errorMessage . "\n";
|
|
} else {
|
|
echo 'Data server received via PUT:' . "\n";
|
|
var_dump($curl->response->form);
|
|
}
|