@@ -379,11 +379,6 @@ immediately instead of waiting to receive the response::
379
379
This component also supports :ref: `streaming responses <http-client-streaming-responses >`
380
380
for full asynchronous applications.
381
381
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
-
387
382
Authentication
388
383
~~~~~~~~~~~~~~
389
384
@@ -899,6 +894,20 @@ Add an ``extra.curl`` option in your configuration to pass those extra options::
899
894
Some cURL options are impossible to override (e.g. because of thread safety)
900
895
and you'll get an exception when trying to override them.
901
896
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
+
902
911
HTTP/2 Support
903
912
~~~~~~~~~~~~~~
904
913
@@ -1970,6 +1979,7 @@ test it in a real application::
1970
1979
}
1971
1980
1972
1981
.. _`cURL PHP extension` : https://www.php.net/curl
1982
+ .. _`Zlib PHP extension` : https://www.php.net/zlib
1973
1983
.. _`PSR-17` : https://www.php-fig.org/psr/psr-17/
1974
1984
.. _`PSR-18` : https://www.php-fig.org/psr/psr-18/
1975
1985
.. _`HTTPlug` : https://github.com/php-http/httplug/#readme
0 commit comments