Mocker icon indicating copy to clipboard operation
Mocker copied to clipboard

How can I mock a request only when needed?

Open gzlboy opened this issue 1 year ago • 2 comments

I integrated Mocker according to the documentation and found that all requests without register will also prompt "No mocked data found for url". Can URLs without register be requested directly?

gzlboy avatar Mar 17 '24 09:03 gzlboy

This issue is stale because it has been open for 30 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Apr 17 '24 00:04 github-actions[bot]

It sounds like you might be wanting to use the "opt in" mode, where the Mocker will only handle requests for URL that were registered, and all other requests will be handled normally. For example, you could add this line when setting up the mocker:

Mocker.mode = .optin

bwhtmn avatar Apr 18 '24 17:04 bwhtmn

This issue is stale because it has been open for 30 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar May 19 '24 00:05 github-actions[bot]