block_requests: Block HTTP requests

View source: R/without-internet.R

block_requestsR Documentation

Block HTTP requests

Description

This function intercepts HTTP requests made through httr and raises an informative error instead. It is what without_internet() does, minus the automatic disabling of mocking when the context finishes.

Usage

block_requests()

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 'without_internet' does.

Value

Nothing; called for its side effects.

See Also

without_internet() stop_mocking() use_mock_api()


httptest documentation built on July 9, 2023, 7:45 p.m.