use_mock_api {httptest}R Documentation

Turn on API mocking

Description

This function intercepts HTTP requests made through httr and serves mock file responses instead. It is what with_mock_api() does, minus the automatic disabling of mocking when the context finishes.

Usage

use_mock_api()

Details

Note that you in order to resume normal request behavior, you will need to call stop_mocking() yourself—this function does not clean up after itself as with_mock_api does.

Value

Nothing; called for its side effects.

See Also

with_mock_api() stop_mocking() block_requests()


[Package httptest version 4.2.2 Index]