File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,20 @@ You can configure the global options using the ``default_options`` option:
138
138
'max_redirects' => 7,
139
139
]);
140
140
141
+ You can also use the :method: `Symfony\\ Contracts\\ HttpClient\\ HttpClientInterface::withOptions `
142
+ method to retrieve a new instance of the client with new default options :
143
+
144
+ .. code-block :: php
145
+
146
+ $this->client = $client->withOptions([
147
+ 'base_uri' => 'https://...',
148
+ 'headers' => ['header-name' => 'value0, value1, ...']
149
+ ]);
150
+
151
+ .. versionadded :: 5.3
152
+
153
+ The :method: `Symfony\\ Contracts\\ HttpClient\\ HttpClientInterface::withOptions ` method was introduced in Symfony 5.3.
154
+
141
155
Some options are described in this guide:
142
156
143
157
* `Authentication `_
You can’t perform that action at this time.
0 commit comments