Skip to content

Conversation

@Dean151
Copy link
Contributor

@Dean151 Dean151 commented Dec 14, 2023

Fixes #19236

Not sure of the documentation format. Open to suggestion to improve it :)

@carsonbot carsonbot added this to the 7.1 milestone Dec 14, 2023
@Dean151 Dean151 changed the title [HttpClient] Added a tip about HttpOptions::setHeaders vs HttpOptions::addHeaders [HttpClient] Added a tip about HttpOptions::setHeaders vs HttpOptions::addHeader Dec 14, 2023
@Dean151 Dean151 force-pushed the httpoptions-addoption branch from dc43787 to efef81b Compare December 14, 2023 14:49
http_client.rst Outdated
$this->client = $client->withOptions(
(new HttpOptions())
->setBaseUri('https://...')
// Set headers replace *all* headers at once, and deletes the headers you do not provide
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Set headers replace *all* headers at once, and deletes the headers you do not provide
// setHeaders() replaces *all* headers at once, and deletes the headers you do not provide
http_client.rst Outdated
->setBaseUri('https://...')
// Set headers replace *all* headers at once, and deletes the headers you do not provide
->setHeaders(['header-name' => 'header-value'])
// Alternatively, add or replace only one header to an existing HttpOptions object.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Alternatively, add or replace only one header to an existing HttpOptions object.
// add or replace a single header using addHeader()
@OskarStark OskarStark changed the title [HttpClient] Added a tip about HttpOptions::setHeaders vs HttpOptions::addHeader [HttpClient] Add HttpOptions::addHeader method Dec 26, 2023
@OskarStark OskarStark force-pushed the httpoptions-addoption branch from 9dd06ab to 436f69e Compare December 26, 2023 20:53
@OskarStark
Copy link
Contributor

Thank you Thomas.

@OskarStark OskarStark merged commit 8c03870 into symfony:7.1 Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment