Skip to content

Commit e10ea5f

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: Added a paragraph about HttpOptions object
2 parents 6b094a4 + c1f6a2a commit e10ea5f

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)