PHP code example of php-http / discovery

1. Go to this page and download the library: Download php-http/discovery 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-http / discovery example snippets


use Http\Discovery\Psr18Client;

$client = new Psr18Client();

$request = $client->createRequest('GET', 'https://example.com');
$response = $client->sendRequest($request);
bash
composer config allow-plugins.php-http/discovery false
bash
composer config allow-plugins.php-http/discovery true
composer install