Skip to content

Commit c3d5e0f

Browse files
committed
feature #17688 [FrameworkBundle] Add extra attribute for HttpClient Configuration (alexandre-daubois)
This PR was merged into the 6.3 branch. Discussion ---------- [FrameworkBundle] Add `extra` attribute for HttpClient Configuration Solves #17659 Commits ------- 856e6f0 [FrameworkBundle] Add extra attribute for HttpClient Configuration
2 parents 7b66696 + 856e6f0 commit c3d5e0f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

http_client.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ method to retrieve a new instance of the client with new default options::
143143

144144
$this->client = $client->withOptions([
145145
'base_uri' => 'https://...',
146-
'headers' => ['header-name' => 'header-value']
146+
'headers' => ['header-name' => 'header-value'],
147+
'extra' => ['my-key' => 'my-value'],
147148
]);
148149

149150
Some options are described in this guide:

reference/configuration/framework.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,18 @@ enabled
10311031
Whether to enable the support for retry failed HTTP request or not.
10321032
This setting is automatically set to true when one of the child settings is configured.
10331033

1034+
extra
1035+
.....
1036+
1037+
**type**: ``array``
1038+
1039+
Arbitrary additional data to pass to the HTTP client for further use.
1040+
This can be particularly useful when :ref:`decorating an existing client <extensibility>`.
1041+
1042+
.. versionadded:: 6.3
1043+
1044+
The ``extra`` option has been introduced in Symfony 6.3.
1045+
10341046
.. _http-headers:
10351047

10361048
headers

0 commit comments

Comments
 (0)