File tree Expand file tree Collapse file tree 4 files changed +14
-7
lines changed
Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -16,5 +16,5 @@ class CURLRequest extends BaseConfig
1616 * If true, all the options won't be reset between requests.
1717 * It may cause an error request with unnecessary headers.
1818 */
19- public bool $ shareOptions = true ;
19+ public bool $ shareOptions = false ;
2020}
Original file line number Diff line number Diff line change @@ -153,6 +153,8 @@ and it is recommended that you merge the updated versions with your application:
153153Config
154154------
155155
156+ - app/Config/CURLRequest.php
157+ - The default value of :ref: `$shareOptions <curlrequest-sharing-options >` has been change to ``false ``.
156158- app/Config/Exceptions.php
157159 - Added the new method ``handler() `` that define custom Exception Handlers.
158160 See :ref: `custom-exception-handlers `.
Original file line number Diff line number Diff line change @@ -23,17 +23,23 @@ to change very little to move over to use Guzzle.
2323Config for CURLRequest
2424**********************
2525
26+ .. _curlrequest-sharing-options :
27+
2628Sharing Options
2729===============
2830
29- Due to historical reasons, by default, the CURLRequest shares all the options between requests.
30- If you send more than one request with an instance of the class,
31- this behavior may cause an error request with unnecessary headers and body .
31+ .. note :: Since v4.4.0, the default value has been changed to ``false``. This
32+ setting exists only for backward compatibility. New users do not need to
33+ change the setting .
3234
33- You can change the behavior by editing the following config parameter value in **app/Config/CURLRequest.php ** to ``false ``:
35+ If you want to share all the options between requests, set ``$shareOptions `` to
36+ ``true `` in **app/Config/CURLRequest.php **:
3437
3538.. literalinclude :: curlrequest/001.php
3639
40+ If you send more than one request with an instance of the class, this behavior
41+ may cause an error request with unnecessary headers and body.
42+
3743.. note :: Before v4.2.0, the request body is not reset even if ``$shareOptions`` is false due to a bug.
3844
3945*******************
Original file line number Diff line number Diff line change 66
77class CURLRequest extends BaseConfig
88{
9- public $ shareOptions = false ;
10-
119 // ...
10+ public bool $ shareOptions = true ;
1211}
You can’t perform that action at this time.
0 commit comments