Skip to content

Commit 3b074fd

Browse files
authored
Merge pull request #248 from demn98/patch-470275
Update http-client.md
2 parents 5d453e5 + 53a1097 commit 3b074fd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

http-client.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
git: c0b77dd72e27ab1f37a4ba9284fffaad1aa999c8
2+
git: 65a9f2e285fad310d2a3de756877b375232ff9fc
33
---
44

55
# HTTP-клиент
@@ -519,6 +519,14 @@ $response = Http::github()->get('/');
519519
'*' => Http::response('Hello World', 200, ['Headers']),
520520
]);
521521

522+
Для удобства можно сгенерировать простую строку, JSON и пустые ответы, указав в качестве ответа строку, массив или целое число:
523+
524+
Http::fake([
525+
'google.com/*' => 'Hello World',
526+
'github.com/*' => ['foo' => 'bar'],
527+
'chatgpt.com/*' => 200,
528+
]);
529+
522530
<a name="faking-connection-exceptions"></a>
523531
#### Имитация исключений соединения
524532

0 commit comments

Comments
 (0)