We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94df07b commit f447179Copy full SHA for f447179
http_client.rst
@@ -138,6 +138,18 @@ You can configure the global options using the ``default_options`` option:
138
'max_redirects' => 7,
139
]);
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
+ $this->client = $client->withOptions([
145
+ 'base_uri' => 'https://...',
146
+ 'headers' => ['header-name' => 'value0, value1, ...']
147
+ ]);
148
149
+.. versionadded:: 5.3
150
151
+ The :method:`Symfony\\Contracts\\HttpClient\\HttpClientInterface::withOptions` method was introduced in Symfony 5.3.
152
153
Some options are described in this guide:
154
155
* `Authentication`_
0 commit comments