Skip to content

Commit e7aa1f1

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: Clarifying how to autowire scoped HTTP clients
2 parents e160c76 + 1e9f420 commit e7aa1f1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

http_client.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ autoconfigure the HTTP client based on the requested URL:
212212
http_client:
213213
scoped_clients:
214214
# only requests matching scope will use these options
215-
github:
215+
github.client:
216216
scope: 'https://api\.github\.com'
217217
headers:
218218
Accept: 'application/vnd.github.v3+json'
@@ -221,7 +221,7 @@ autoconfigure the HTTP client based on the requested URL:
221221
222222
# using base_uri, relative URLs (e.g. request("GET", "/repos/symfony/symfony-docs"))
223223
# will default to these options
224-
github:
224+
github.client:
225225
base_uri: 'https://api.github.com'
226226
headers:
227227
Accept: 'application/vnd.github.v3+json'
@@ -242,7 +242,7 @@ autoconfigure the HTTP client based on the requested URL:
242242
<framework:config>
243243
<framework:http-client>
244244
<!-- only requests matching scope will use these options -->
245-
<framework:scoped-client name="github"
245+
<framework:scoped-client name="github.client"
246246
scope="https://api\.github\.com"
247247
>
248248
<framework:header name="Accept">application/vnd.github.v3+json</framework:header>
@@ -251,7 +251,7 @@ autoconfigure the HTTP client based on the requested URL:
251251
252252
<!-- using base-uri, relative URLs (e.g. request("GET", "/repos/symfony/symfony-docs"))
253253
will default to these options -->
254-
<framework:scoped-client name="github"
254+
<framework:scoped-client name="github.client"
255255
base-uri="https://api.github.com"
256256
>
257257
<framework:header name="Accept">application/vnd.github.v3+json</framework:header>
@@ -268,7 +268,7 @@ autoconfigure the HTTP client based on the requested URL:
268268
'http_client' => [
269269
'scoped_clients' => [
270270
// only requests matching scope will use these options
271-
'github' => [
271+
'github.client' => [
272272
'scope' => 'https://api\.github\.com',
273273
'headers' => [
274274
'Accept' => 'application/vnd.github.v3+json',
@@ -279,7 +279,7 @@ autoconfigure the HTTP client based on the requested URL:
279279
280280
// using base_url, relative URLs (e.g. request("GET", "/repos/symfony/symfony-docs"))
281281
// will default to these options
282-
'github' => [
282+
'github.client' => [
283283
'base_uri' => 'https://api.github.com',
284284
'headers' => [
285285
'Accept' => 'application/vnd.github.v3+json',
@@ -326,8 +326,8 @@ Each client has a unique service named after its configuration.
326326

327327
Each scoped client also defines a corresponding named autowiring alias.
328328
If you use for example
329-
``Symfony\Contracts\HttpClient\HttpClientInterface $myApiClient``
330-
as the type and name of an argument, autowiring will inject the ``my_api.client``
329+
``Symfony\Contracts\HttpClient\HttpClientInterface $githubClient``
330+
as the type and name of an argument, autowiring will inject the ``github.client``
331331
service into your autowired classes.
332332

333333
.. note::

0 commit comments

Comments
 (0)