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

Appearance settings

Commit 65a9f2e

Browse filesBrowse files
committed
convenience methods
1 parent f821f3d commit 65a9f2e
Copy full SHA for 65a9f2e

File tree

Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed

‎http-client.md

Copy file name to clipboardExpand all lines: http-client.md
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,14 @@ If you would like to specify a fallback URL pattern that will stub all unmatched
530530
'*' => Http::response('Hello World', 200, ['Headers']),
531531
]);
532532

533+
For convenience, simple string, JSON, and empty responses may be generated by providing a string, array, or integer as the response:
534+
535+
Http::fake([
536+
'google.com/*' => 'Hello World',
537+
'github.com/*' => ['foo' => 'bar'],
538+
'chatgpt.com/*' => 200,
539+
]);
540+
533541
<a name="faking-connection-exceptions"></a>
534542
#### Faking Connection Exceptions
535543

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.