1. Go to this page and download the library: Download ez-php/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 EzPhp\HttpClient\HttpClient;
$client = $app->make(HttpClient::class);
$response = $client->get('https://api.example.com')->send();
use EzPhp\HttpClient\FakeTransport;
use EzPhp\HttpClient\Http;
use EzPhp\HttpClient\HttpClient;
use EzPhp\HttpClient\HttpResponse;
$fake = new FakeTransport(new HttpResponse(200, '{"id":1}', []));
Http::setClient(new HttpClient($fake));
// Act — no real network calls
$data = Http::get('https://api.example.com/users/1')->json();
Http::resetClient();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.