Test Helpers for 'httr2'
Wrap a redacting expression as a proper function
Convert a request to a mock file path
Record API responses as mock files
Handle a change of server state
Use 'httptest2' in your tests
Test that an HTTP request is made with a header
Expectations for mocked HTTP requests
Go through mock paths to find the local mock file location
Fetch the active redacting function
Find and replace within a response object
httptest2: A Test Environment for HTTP Requests
Set an alternate directory for mock API fixtures
Remove sensitive content from HTTP responses
Write out a captured response
Set a response redactor
Set mocking/capturing state for a vignette
Serve a mock API from files
Use or create mock files depending on their existence
Wrapper around 'trace' to untrace when finished
Make all HTTP requests raise an error
Testing and documenting code that communicates with remote servers can be painful. This package helps with writing tests for packages that use 'httr2'. It enables testing all of the logic on the R sides of the API without requiring access to the remote service, and it also allows recording real API responses to use as test fixtures. The ability to save responses and load them offline also enables writing vignettes and other dynamic documents that can be distributed without access to a live server.
Useful links