Skip to content

[HttpClient] [http_client] Fix default headers #14907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions http_client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,10 @@ requests and the specific headers for each request:

# config/packages/framework.yaml
framework:
http_client:
headers:
'User-Agent': 'My Fancy App'
default_options:
http_client:
headers:
'User-Agent': 'My Fancy App'

.. code-block:: xml

Expand All @@ -528,7 +529,9 @@ requests and the specific headers for each request:

<framework:config>
<framework:http-client>
<framework:header name="User-Agent">My Fancy App</framework:header>
<framework:default-options>
<framework:header name="User-Agent">My Fancy App</framework:header>
</framework:default-options>
</framework-http-client>
</framework:config>
</container>
Expand All @@ -538,8 +541,10 @@ requests and the specific headers for each request:
// config/packages/framework.php
$container->loadFromExtension('framework', [
'http_client' => [
'headers' => [
'User-Agent' => 'My Fancy App',
'default_options' => [
'headers' => [
'User-Agent' => 'My Fancy App',
],
],
],
]);
Expand Down