You are here

public static function Drupal::httpClient in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal.php \Drupal::httpClient()

Returns the default http client.

Return value

\GuzzleHttp\Client A guzzle http client instance.

8 calls to Drupal::httpClient()
DrupalTest::testHttpClient in core/tests/Drupal/Tests/Core/DrupalTest.php
Tests the httpClient() method.
RESTTestBase::httpRequest in core/modules/rest/src/Tests/RESTTestBase.php
Helper function to issue a HTTP request with simpletest's cURL.
StatisticsAdminTest::setUp in core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php
StatisticsLoggingTest::setUp in core/modules/statistics/tests/src/Functional/StatisticsLoggingTest.php
StatisticsReportsTest::testPopularContentBlock in core/modules/statistics/tests/src/Functional/StatisticsReportsTest.php
Tests the "popular content" block.

... See full list

File

core/lib/Drupal.php, line 465
Contains \Drupal.

Class

Drupal
Static Service Container wrapper.

Code

public static function httpClient() {
  return static::getContainer()
    ->get('http_client');
}