use_mock_api: Turn on API mocking

View source: R/mock-api.R

use_mock_apiR 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()


nealrichardson/httptest documentation built on Feb. 5, 2024, 12:35 a.m.