1. Go to this page and download the library: Download amphp/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/ */
use Amp\Http\Client\Client;
use Amp\Http\Client\HttpClientBuilder;
use Amp\Http\Client\Interceptor\SetRequestHeader;
use Amp\Http\Client\Interceptor\SetResponseHeader;
use Amp\Http\Client\Request;
$client = (new HttpClientBuilder)
->intercept(new SetRequestHeader('x-foo', 'bar'))
->intercept(new SetResponseHeader('x-tea', 'now'))
->build();
$response = $client->request(new Request("https://httpbin.org/get"));
$body = $response->getBody()->buffer();
use Amp\Http\Client\HttpClientBuilder;
use Amp\Http\Client\EventListener\LogHttpArchive;
$httpClient = (new HttpClientBuilder)
->listen(new LogHttpArchive('/tmp/http-client.har'))
->build();
$httpClient->request(...);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.