Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit26d763e

Browse files
committed
[HttpClient] HttpClientInterface::setResponseFactory method
1 parent14d05b1 commit26d763e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎http_client.rst‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,6 +1710,19 @@ However, using ``MockResponse`` allows simulating chunked responses and timeouts
17101710

17111711
The feature explained below was introduced in Symfony 5.2.
17121712

1713+
Also you can use setter method for all kinds of responses described above::
1714+
1715+
$responses = [
1716+
new MockResponse($body1, $info1),
1717+
new MockResponse($body2, $info2),
1718+
];
1719+
1720+
$client->setResponseFactory($responses);
1721+
1722+
..versionadded::5.4
1723+
1724+
The ``setResponseFactory()`` method was introduced in Symfony 5.4.
1725+
17131726
Finally, you can also create an invokable or iterable class that generates the
17141727
responses and use it as a callback in functional tests::
17151728

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp