File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,18 @@ 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
+ $this->client = $client->withOptions([
145
+ 'base_uri' => 'https://...',
146
+ 'headers' => ['header-name' => 'header-value']
147
+ ]);
148
+
149
+ .. versionadded :: 5.3
150
+
151
+ The ``withOptions() `` method was introduced in Symfony 5.3.
152
+
141
153
Some options are described in this guide:
142
154
143
155
* `Authentication `_
Original file line number Diff line number Diff line change @@ -497,7 +497,7 @@ the MongoDB connection as argument:
497
497
// config/services.php
498
498
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
499
499
500
- use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler ;
500
+ use Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler ;
501
501
502
502
return static function (ContainerConfigurator $container) {
503
503
$services = $configurator->services();
@@ -606,7 +606,7 @@ configure these values with the second argument passed to the
606
606
// config/services.php
607
607
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
608
608
609
- use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler ;
609
+ use Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler ;
610
610
611
611
return static function (ContainerConfigurator $container) {
612
612
$services = $configurator->services();
You can’t perform that action at this time.
0 commit comments