mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-24 12:29:26 +00:00
18 lines
328 B
PHP
18 lines
328 B
PHP
<?php
|
|
require '../src/Curl/Curl.php';
|
|
|
|
use \Curl\Curl;
|
|
|
|
$myfile = curl_file_create('cats.jpg', 'image/png', 'test_name');
|
|
|
|
$curl = new Curl();
|
|
$curl->post('https://httpbin.org/post', array(
|
|
'myfile' => $myfile,
|
|
));
|
|
|
|
if ($curl->error) {
|
|
echo 'Error: ' . $curl->error_message . "\n";
|
|
} else {
|
|
echo 'Success' . "\n";
|
|
}
|