After creating a recording, you can replay it by loading it into a mock server instance using the
httpmock Rust API as follows:
After calling MockServer::playback,
the recording will be loaded into the mock server. This allows all previously recorded requests to act as matching
criteria, similar to how you configure normal mocks using
MockServer::mock with the
When structure.
Hereafter, whenever the mock server receives a request that matches any of the recorded requests, it will
respond with the corresponding recorded response.
Full Example
The following example demonstrates how you can use the forwarding feature to record and playback
requests sent to the GitHub API and the responses it returns.