@@ -46,14 +46,13 @@ with HTTP/2 and with doing concurrent asynchronous streamed and multiplexed
4646requests/responses. Even when doing regular synchronous calls, this design
4747allows keeping connections to remote hosts open between requests, improving
4848performance by saving repetitive DNS resolution, SSL negotiation, etc.
49- To leverage all these design benefits, the cURL extension is needed.
5049
5150Enabling cURL Support
5251~~~~~~~~~~~~~~~~~~~~~
5352
5453This component supports both the native PHP streams and cURL to make the HTTP
55- requests. Although both are interchangeable and provide the same features,
56- including concurrent requests, HTTP/2 is only supported when using cURL .
54+ requests. Both are interchangeable and provide the same features, including
55+ concurrent requests and HTTP/2 support .
5756
5857``HttpClient::create() `` selects the cURL transport if the `cURL PHP extension `_
5958is enabled and falls back to PHP streams otherwise. If you prefer to select
@@ -75,9 +74,21 @@ is installed and enabled. Otherwise, the native PHP streams will be used.
7574HTTP/2 Support
7675~~~~~~~~~~~~~~
7776
78- When requesting an ``https `` URL, HTTP/2 is enabled by default if libcurl >= 7.36
79- is used. To force HTTP/2 for ``http `` URLs, you need to enable it explicitly via
80- the ``http_version `` option::
77+ .. versionadded :: 5.1
78+
79+ Integration with ``amphp/http-client `` was introduced in Symfony 5.1.
80+ Prior to this version, HTTP/2 was only supported when ``libcurl `` was
81+ installed.
82+
83+ The component supports HTTP/2 if one of the following tools is
84+ installed:
85+
86+ * The `libcurl `_ package version 7.36 or higher;
87+ * The `amphp/http-client `_ Packagist package version 4.2 or higher.
88+
89+ When requesting an ``https `` URL and HTTP/2 is supported by your server,
90+ HTTP/2 is enabled by default. To force HTTP/2 for ``http `` URLs, you need
91+ to enable it explicitly via the ``http_version `` option::
8192
8293 $client = HttpClient::create(['http_version' => '2.0']);
8394
@@ -1021,3 +1032,5 @@ However, using ``MockResponse`` allows simulating chunked responses and timeouts
10211032.. _`PSR-18` : https://www.php-fig.org/psr/psr-18/
10221033.. _`HTTPlug` : https://github.com/php-http/httplug/#readme
10231034.. _`Symfony Contracts` : https://github.com/symfony/contracts
1035+ .. _`libcurl` : https://curl.haxx.se/libcurl/
1036+ .. _`amphp/http-client` : https://packagist.org/packages/amphp/http-client
0 commit comments