PHP code example of ergebnis / http-method

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

    

ergebnis / http-method example snippets




declare(strict_types=1);

use Ergebnis\Http\Method;
use Psr\Http\Client;
use Psr\Http\Message;

/** @var Message\RequestFactoryInterface $requestFactory */
$request = $requestFactory->create(
    Method::GET,
    'https://localheinz.com/articles/'
);

/** @var Client\ClientInterface $httpClient */
$httpClient->sendRequest($request);