We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
HttpOptions::addHeader
1 parent c64e7e7 commit 436f69eCopy full SHA for 436f69e
http_client.rst
@@ -150,10 +150,17 @@ brings most of the available options with type-hinted getters and setters::
150
$this->client = $client->withOptions(
151
(new HttpOptions())
152
->setBaseUri('https://...')
153
+ // setHeaders() replaces *all* headers at once, and deletes the headers you do not provide
154
->setHeaders(['header-name' => 'header-value'])
155
+ // add or replace a single header using addHeader()
156
+ ->addHeader('another-header-name', 'another-header-value')
157
->toArray()
158
);
159
160
+.. versionadded:: 7.1
161
+
162
+ The :method:`Symfony\\Component\\HttpClient\\HttpOptions::addHeader` method was introduced in Symfony 7.1.
163
164
Some options are described in this guide:
165
166
* `Authentication`_
0 commit comments