Change record status: 
Project: 
Introduced in branch: 
8.0.x
Introduced in version: 
8.0.0-beta13
Description: 

#2493911: Update guzzle, goutte and mink-goutte-driver to the latest release updated the used guzzle version to guzzle 6.
The main part of that update was the update to use PSR-7 instead of RingPHP.

For usages of the guzzle HTTP client though almost nothing changes, so code like:

$client = \Drupal::client();
$result = $client->get('https://www.drupal.org');
// ...

continues to work. For more documentation around guzzle, read https://guzzle.readthedocs.org/en/latest/

Incompatibilities

There are a couple of incompatibilities.

  • You had a custom subscriber. This is now replaced by a middleware approach. So subscribers needs to be tagged with "http_client_middleware" in your services.yml file.
    The middleware then needs to implement __invoke() and return a function which takes a handler. For an actual example, please look at \Drupal\Core\Test\EventSubscriber\TestHttpClientMiddleware. For more information read more on https://guzzle.readthedocs.org/en/latest/handlers-and-middleware.html
  • You wanted to have a custom connection setting. For that usecase we introduced a new client factory:http_client_factory
    Before
        $this->client = \Drupal::httpClient();
        $this->client->setDefaultOption('config/curl', array(CURLOPT_TIMEOUT => 10));
    
    After
        $this->client = \Drupal::service('http_client_factory')
          ->fromOptions(['config/curl' => [CURLOPT_TIMEOUT => 10]]);
    
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done