@@ -375,11 +375,6 @@ immediately instead of waiting to receive the response::
375
375
This component also supports :ref: `streaming responses <http-client-streaming-responses >`
376
376
for full asynchronous applications.
377
377
378
- .. note ::
379
-
380
- HTTP compression and chunked transfer encoding are automatically enabled when
381
- both your PHP runtime and the remote server support them.
382
-
383
378
Authentication
384
379
~~~~~~~~~~~~~~
385
380
@@ -875,6 +870,20 @@ Add an ``extra.curl`` option in your configuration to pass those extra options::
875
870
Some cURL options are impossible to override (e.g. because of thread safety)
876
871
and you'll get an exception when trying to override them.
877
872
873
+ HTTP Compression
874
+ ~~~~~~~~~~~~~~~~
875
+
876
+ The HTTP header ``Accept-Encoding: gzip `` is added automatically if:
877
+
878
+ * When using cURL client: cURL was compiled with ZLib support (see ``php --ri curl ``)
879
+ * When using the native HTTP client: `Zlib PHP extension `_ is installed
880
+
881
+ If the server does respond with a gzipped response, it's decoded transparently.
882
+ To disable HTTP compression, send an ``Accept-Encoding: identity `` HTTP header.
883
+
884
+ Chunked transfer encoding is enabled automatically if both your PHP runtime and
885
+ the remote server supports it.
886
+
878
887
HTTP/2 Support
879
888
~~~~~~~~~~~~~~
880
889
@@ -1919,6 +1928,7 @@ test it in a real application::
1919
1928
}
1920
1929
1921
1930
.. _`cURL PHP extension` : https://www.php.net/curl
1931
+ .. _`Zlib PHP extension` : https://www.php.net/zlib
1922
1932
.. _`PSR-17` : https://www.php-fig.org/psr/psr-17/
1923
1933
.. _`PSR-18` : https://www.php-fig.org/psr/psr-18/
1924
1934
.. _`HTTPlug` : https://github.com/php-http/httplug/#readme
0 commit comments