Skip to content

Commit 891f771

Browse files
authored
[http_client] Fix default headers
1 parent 358b635 commit 891f771

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

http_client.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,10 @@ requests and the specific headers for each request:
511511
512512
# config/packages/framework.yaml
513513
framework:
514-
http_client:
515-
headers:
516-
'User-Agent': 'My Fancy App'
514+
default_options:
515+
http_client:
516+
headers:
517+
'User-Agent': 'My Fancy App'
517518
518519
.. code-block:: xml
519520
@@ -528,7 +529,9 @@ requests and the specific headers for each request:
528529
529530
<framework:config>
530531
<framework:http-client>
531-
<framework:header name="User-Agent">My Fancy App</framework:header>
532+
<framework:default-options>
533+
<framework:header name="User-Agent">My Fancy App</framework:header>
534+
</framework:default-options>
532535
</framework-http-client>
533536
</framework:config>
534537
</container>
@@ -538,8 +541,10 @@ requests and the specific headers for each request:
538541
// config/packages/framework.php
539542
$container->loadFromExtension('framework', [
540543
'http_client' => [
541-
'headers' => [
542-
'User-Agent' => 'My Fancy App',
544+
'default_options' => [
545+
'headers' => [
546+
'User-Agent' => 'My Fancy App',
547+
],
543548
],
544549
],
545550
]);

0 commit comments

Comments
 (0)