Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a86103

Browse files
committed
Merge branch '5.4' into 6.3
* 5.4: Added a paragraph about HttpOptions object
2 parents bdaed89 + ab38701 commit 2a86103

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

http_client.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@ method to retrieve a new instance of the client with new default options::
144144
'extra' => ['my-key' => 'my-value'],
145145
]);
146146

147+
Alternatively, the :class:`Symfony\\Component\\HttpClient\\HttpOptions` class brings most of the available options with
148+
type-hinted getters and setters::
149+
150+
$this->client = $client->withOptions(
151+
(new HttpOptions())
152+
->setBaseUri('https://...')
153+
->setHeaders(['header-name' => 'header-value'])
154+
->toArray()
155+
);
156+
147157
Some options are described in this guide:
148158

149159
* `Authentication`_

0 commit comments

Comments
 (0)