PHP code example of dannymeyer / guzzlehttp-multicurl

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

    

dannymeyer / guzzlehttp-multicurl example snippets


$curl = new \DannyMeyer\Curl\Multicurl();

$curl->addGetRequestByUri('https://my.domain/ExampleRequest');
$curl->addGetRequestByUri('https://my.domain/AnotherExampleRequest');

$result = $curl->execute();

if ($curl->hasErrors()) {
    var_dump($curl->getErrors());
}

$curl = new \DannyMeyer\Curl\Multicurl();
$request = new \GuzzleHttp\Psr7\Request(
    'get',
    'https://my.domain/ExampleRequest',
    ['Authorization' => 'Basic ' . \base64_encode('User:Password')]
);

$curl->addRequest($request);