8000 minor #15370 [HttpClient] HttpClientInterface::withOptions method (0x… · SirRFI/symfony-docs@27797b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 27797b4

Browse files
committed
minor symfony#15370 [HttpClient] HttpClientInterface::withOptions method (0x346e3730)
This PR was squashed before being merged into the 5.3 branch. Discussion ---------- [HttpClient] HttpClientInterface::withOptions method Closes symfony#15033 by documenting the HttpClientInterface::withOptions method Commits ------- f447179 [HttpClient] HttpClientInterface::withOptions method
2 parents 0245101 + f447179 commit 27797b4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

http_client.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,18 @@ You can configure the global options using the ``default_options`` option:
138138
'max_redirects' => 7,
139139
]);
140140
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+
141153
Some options are described in this guide:
142154

143155
* `Authentication`_

0 commit comments

Comments
 (0)
0