mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-10-05 19:46:52 +00:00
Add additional examples to cover supported request methods
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
use \Curl\Curl;
|
||||
|
||||
// curl --request DELETE "https://httpbin.org/delete?key=value" --data "a=1&b=2&c=3"
|
||||
|
||||
$curl = new Curl();
|
||||
$curl->delete('https://httpbin.org/delete',
|
||||
array(
|
||||
'key' => 'value',
|
||||
),
|
||||
array(
|
||||
'a' => '1',
|
||||
'b' => '2',
|
||||
'c' => '3',
|
||||
)
|
||||
);
|
||||
|
||||
if ($curl->error) {
|
||||
echo 'Error: ' . $curl->errorCode . ': ' . $curl->errorMessage;
|
||||
} else {
|
||||
echo 'Data server received via DELETE:' . "\n";
|
||||
var_dump($curl->response->form);
|
||||
}
|
||||
Reference in New Issue
Block a user