PHP code example of nyholm / http-client

1. Go to this page and download the library: Download nyholm/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/ */

    

nyholm / http-client example snippets


// Create a PSR-7 request
$request = MessageFactoryDiscovery::find()->createRequest('GET', 'http://example.com');

// You will get back a PSR-7 response
$response = (new Client)->sendRequest($request);