@@ -728,15 +728,19 @@ When using this component in a full-stack Symfony application, this behavior is
728
728
not configurable and cURL will be used automatically if the cURL PHP extension
729
729
is installed and enabled. Otherwise, the native PHP streams will be used.
730
730
731
- Providing Additional Options to CurlHttpClient
732
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
731
+ Configuring CurlHttpClient Options
732
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
733
733
734
- It is possible to provide additional cURL options to ``CurlHttpClient ``. PHP exposes
735
- a lot of `cURL options `_ that can be passed to ``curl_setopt `` function, but only some
736
- of them are used in ``CurlHttpClient `` in favor of bigger component portability.
734
+ .. versionadded :: 5.2
737
735
738
- To provide cURL-related parameters to request, add an ``extra.curl `` option in your
739
- configuration::
736
+ The feature to configure extra cURL options was introduced in Symfony 5.2.
737
+
738
+ PHP allows to configure lots of `cURL options `_ via the :phpfunction: `curl_setopt `
739
+ function. In order to make the component more portable when not using cURL, the
740
+ ``CurlHttpClient `` only uses some of those options (and they are ignored in the
741
+ rest of clients).
742
+
743
+ Add an ``extra.curl `` option in your configuration to pass those extra options::
740
744
741
745
use Symfony\Component\HttpClient\CurlHttpClient;
742
746
@@ -751,15 +755,10 @@ configuration::
751
755
]
752
756
]);
753
757
754
-
755
- This option is available only when using ``CurlHttpClient ``, other clients will ignore these options.
756
-
757
758
.. note ::
758
759
759
- Some cURL options are impossible to override due of. e.g Thread Safety or existing options in
760
- ``$options `` configuration which will set given attributes internally. An exception will be
761
- thrown while overriding them.
762
-
760
+ Some cURL options are impossible to override (e.g. because of thread safety)
761
+ and you'll get an exception when trying to override them.
763
762
764
763
HTTP/2 Support
765
764
~~~~~~~~~~~~~~
0 commit comments