extension=curl
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://api.example.com/method');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://api.example.com/method');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, ['param1' =>'value1']);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://api.example.com/method');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, ['param1' =>'value1']);
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'ftp://example.com/path/to/file');
curl_setopt($curl, CURLOPT_UPLOAD, true);
curl_setopt($curl, CURLOPT_INFILE, fopen('/path/to/local/file', 'r'));
curl_exec($curl);
curl_close($curl);