Skip to content

Commit f4da19e

Browse files
committed
Merge branch '7.4' into 8.0
* 7.4: Tweaks and rewords [HttpClient] Document new option `auto_upgrade_http_version`
2 parents d8be724 + 8f7bcf7 commit f4da19e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

http_client.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,6 +1783,28 @@ You can also pass a set of default options to your client thanks to the
17831783

17841784
// ...
17851785

1786+
.. _auto-upgrade-http-version:
1787+
1788+
You can use the ``auto_upgrade_http_version`` option to control whether the HTTP
1789+
protocol version is automatically upgraded::
1790+
1791+
$client = (new Psr18Client())
1792+
->withOptions([
1793+
// set to false to always use the HTTP version defined in your request;
1794+
// set to true to allow the server to upgrade the HTTP version in its response
1795+
'auto_upgrade_http_version' => false
1796+
// ...
1797+
]);
1798+
1799+
.. note::
1800+
1801+
The ``auto_upgrade_http_version`` option is ignored for HTTP/1.0 requests,
1802+
which always keep that protocol version.
1803+
1804+
.. versionadded:: 7.4
1805+
1806+
The ``auto_upgrade_http_version`` option was introduced in Symfony 7.4.
1807+
17861808
HTTPlug
17871809
~~~~~~~
17881810

@@ -1884,6 +1906,10 @@ You can also pass a set of default options to your client thanks to the
18841906

18851907
// ...
18861908

1909+
1910+
See the :ref:`auto_upgrade_http_version <auto-upgrade-http-version>` option for
1911+
details about how the HTTP protocol version selection works.
1912+
18871913
Native PHP Streams
18881914
~~~~~~~~~~~~~~~~~~
18891915

0 commit comments

Comments
 (0)