1. Go to this page and download the library: Download php-comp/http-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
php-comp / http-client example snippets
use PhpPkg\Http\Client\Client;
// use factory
$client = Client::factory([
'driver' => 'curl', // stream, fsock, fopen, file, co, co2
// ... 更多选项
'baseUrl' => 'http://my-site.com'
]);