@@ -379,11 +379,6 @@ immediately instead of waiting to receive the response::
379379This component also supports :ref: `streaming responses <http-client-streaming-responses >`
380380for full asynchronous applications.
381381
382- .. note ::
383-
384- HTTP compression and chunked transfer encoding are automatically enabled when
385- both your PHP runtime and the remote server support them.
386-
387382Authentication
388383~~~~~~~~~~~~~~
389384
@@ -899,6 +894,20 @@ Add an ``extra.curl`` option in your configuration to pass those extra options::
899894 Some cURL options are impossible to override (e.g. because of thread safety)
900895 and you'll get an exception when trying to override them.
901896
897+ HTTP Compression
898+ ~~~~~~~~~~~~~~~~
899+
900+ The HTTP header ``Accept-Encoding: gzip `` is added automatically if:
901+
902+ * When using cURL client: cURL was compiled with ZLib support (see ``php --ri curl ``)
903+ * When using the native HTTP client: `Zlib PHP extension `_ is installed
904+
905+ If the server does respond with a gzipped response, it's decoded transparently.
906+ To disable HTTP compression, send an ``Accept-Encoding: identity `` HTTP header.
907+
908+ Chunked transfer encoding is enabled automatically if both your PHP runtime and
909+ the remote server supports it.
910+
902911HTTP/2 Support
903912~~~~~~~~~~~~~~
904913
@@ -1970,6 +1979,7 @@ test it in a real application::
19701979 }
19711980
19721981.. _`cURL PHP extension` : https://www.php.net/curl
1982+ .. _`Zlib PHP extension` : https://www.php.net/zlib
19731983.. _`PSR-17` : https://www.php-fig.org/psr/psr-17/
19741984.. _`PSR-18` : https://www.php-fig.org/psr/psr-18/
19751985.. _`HTTPlug` : https://github.com/php-http/httplug/#readme
0 commit comments